fix: v0.7.2 语句级原子性 + 事务 DDL 拒绝 + 约束/绑定硬化 — 6 项修复 + 43 回归 + CI 重型套件串行
CI / test (22.x) (push) Successful in 24m26s
CI / e2e (push) Successful in 10m0s
CI / test (18.x) (push) Successful in 27m14s
CI / test (20.x) (push) Failing after 1h19m9s
CI / test (24.x) (push) Successful in 37m49s

- UPDATE 语句级部分提交(P1,四引擎):两阶段全量预检后执行,批内唯一互查,
  任何一行失败整句不执行(aria 场景 WAL 与内存不再错位)
- 事务内 ALTER/CREATE INDEX/DROP INDEX 残留(P1):Memory/KVStore 显式拒绝
  (对齐 Aria),createTable/dropTable 保持可回滚
- SET NULL 级联绕过 required 约束(P1):预检阶段整体拒绝 FOREIGN_KEY_VIOLATION
- bindParameters 注释误判(P2):行注释/块注释中的 ? 与引号不再参与绑定
- 未闭合字符串静默接受 → lexer 抛 PARSE_ERROR;未知 where 操作符抛 QUERY_ERROR
- UPDATE undefined 覆盖列值 → 语义化为不更新(null 仍置空)
- Hybrid 写穿透非原子(P1):磁盘失败自动重载内存对齐磁盘再抛原错误
- CI:Run tests 拆常规并行 + 重型串行(runInBand),重型测试超时余量提升,
  性能护栏 kv 120→240s / opfs 150→300s(仍拦截悬崖回归)
- 测试 1155 → 1198(74 套件),覆盖率 89.82% 保持
This commit is contained in:
thzxx
2026-08-13 15:31:16 +08:00
parent cbe407eb49
commit 05e6823bf1
31 changed files with 2635 additions and 762 deletions
+14 -13
View File
@@ -84,7 +84,7 @@ describe('AriaEngine — 生产负载验证', () => {
// 索引(重启重建)
expect(await engine2.find('big', { table: 'big', where: { tag: 't5' } })).toHaveLength(5000);
await engine2.close();
}, 180000);
}, 600000);
it('高频更新/删除(Compaction 回收墓碑)→ 重启后一致', async () => {
const dbName = uniqueDB();
@@ -127,7 +127,7 @@ describe('AriaEngine — 生产负载验证', () => {
await engine2.open(dbName, 1);
expect(await engine2.count('big')).toBe(count);
await engine2.close();
}, 120000);
}, 600000);
it('大 value100KB × 50)压缩写入/恢复完整', async () => {
const dbName = uniqueDB();
@@ -161,7 +161,7 @@ describe('AriaEngine — 生产负载验证', () => {
const one = await engine2.find('docs', { table: 'docs', where: { id: 'd25' } });
expect((one[0].body as string).length).toBe(chunk.length);
await engine2.close();
}, 120000);
}, 600000);
it('混合操作 + 崩溃:已确认写入零丢失(20000 操作)', async () => {
const dbName = uniqueDB();
@@ -217,7 +217,7 @@ describe('AriaEngine — 生产负载验证', () => {
expect(rows[0].val).toBe(expected.val);
}
await engine2.close();
}, 120000);
}, 600000);
it('大量删除(90% 行)+ Compaction → 重启无残留(墓碑清理)', async () => {
const dbName = uniqueDB();
@@ -253,7 +253,7 @@ describe('AriaEngine — 生产负载验证', () => {
const all = await engine2.find('big', { table: 'big' });
expect(all.every((r) => Number(String(r.id).slice(1)) < 1000)).toBe(true);
await engine2.close();
}, 120000);
}, 600000);
it('kv 后端 5 万行(页面化路径):写入 → 崩溃 → 恢复完整', async () => {
const dbName = uniqueDB();
@@ -289,7 +289,7 @@ describe('AriaEngine — 生产负载验证', () => {
expect(await engine2.count('big')).toBe(TOTAL);
expect(await engine2.find('big', { table: 'big', where: { tag: 't3' } })).toHaveLength(5000);
await engine2.close();
}, 180000);
}, 600000);
it('10 万行 kv 后端(含索引):完整查询 + 崩溃恢复(v0.6.1-perf 回归)', async () => {
const dbName = uniqueDB();
@@ -314,10 +314,11 @@ describe('AriaEngine — 生产负载验证', () => {
}
const insertMs = Date.now() - t0;
// 性能护栏:修复前 353sbatch 32 起每批 8~11s 性能悬崖),
// 修复后本机 ~30s。CIdebian runner + maxWorkers=2 并行重型测试)慢 2~3 倍,
// 护栏放宽到 120s —— 仍能拦截性能悬崖回归(353s >> 120s),不误报健康慢环境。
// 修复后本机 ~12.5s。CIdebian runner 慢 2~3 倍、重型套件串行)下
// 健康耗时约 30~80s护栏放宽到 240s —— 仍能拦截性能悬崖回归(353s >> 240s),
// 不误报健康慢环境。
console.log(`10万行 kv 插入耗时: ${insertMs}ms`);
expect(insertMs).toBeLessThan(120000);
expect(insertMs).toBeLessThan(240000);
expect(await engine.count('big')).toBe(TOTAL);
// 全部 10 个 tag 索引查询完整
@@ -339,7 +340,7 @@ describe('AriaEngine — 生产负载验证', () => {
expect(await engine2.count('big')).toBe(TOTAL);
expect(await engine2.find('big', { table: 'big', where: { tag: 't7' } })).toHaveLength(10000);
await engine2.close();
}, 180000);
}, 600000);
it('10 万行 opfs 后端(含索引):完整查询(v0.6.1-perf 回归)', async () => {
const engine = new AriaEngine({
@@ -362,14 +363,14 @@ describe('AriaEngine — 生产负载验证', () => {
await engine.insert('big', rows);
}
const insertMs = Date.now() - t0;
// 同上:CI 慢环境护栏放宽(本机 ~25s)
// 同上:CI 慢环境护栏放宽(本机 ~25s;悬崖回归仍会被拦截
console.log(`10万行 opfs 插入耗时: ${insertMs}ms`);
expect(insertMs).toBeLessThan(150000);
expect(insertMs).toBeLessThan(300000);
expect(await engine.count('big')).toBe(TOTAL);
for (let t = 0; t < 10; t++) {
const viaIdx = await engine.find('big', { table: 'big', where: { tag: `t${t}` } });
expect(viaIdx.length).toBe(10000);
}
await engine.close();
}, 180000);
}, 600000);
});