release: v0.6.0 — 完全移除 IndexedDB,自研 KVStore 事务存储引擎(多key原子写/快照日志恢复/CRC自愈)+ KVStoreEngine + 旧库迁移工具 + 10万级压力验证 + 崩溃注入e2e
This commit is contained in:
@@ -21,7 +21,7 @@ import { SegmentedWALStore } from './wal/segmented_store';
|
||||
import { DatabaseLock } from './locks';
|
||||
import { WALRecordType, type WALRecord } from './types';
|
||||
import { CheckpointManager } from './wal/checkpoint';
|
||||
import { IndexedDBBackend, MemoryBackend, type IStorageBackend } from './store/backend';
|
||||
import { MemoryBackend, type IStorageBackend } from './store/backend';
|
||||
import { OPFSBackend } from './store/opfs_backend';
|
||||
import { EncryptedBackend } from './store/encrypted_backend';
|
||||
import { PageSSTableStore } from './store/page_sstable_store';
|
||||
@@ -117,8 +117,6 @@ export class AriaEngine implements IStorageEngine {
|
||||
let baseBackend: IStorageBackend;
|
||||
if (this.config.storageBackend === 'opfs') {
|
||||
baseBackend = new OPFSBackend();
|
||||
} else if (this.config.storageBackend === 'indexeddb') {
|
||||
baseBackend = new IndexedDBBackend();
|
||||
} else {
|
||||
baseBackend = new MemoryBackend();
|
||||
}
|
||||
@@ -300,10 +298,10 @@ export class AriaEngine implements IStorageEngine {
|
||||
*/
|
||||
async repair(): Promise<void> {
|
||||
this.ensureOpen();
|
||||
// v0.6.0-fix: 先清页面缓存再校验 — 缓存中的"完好页面"会掩盖磁盘损坏
|
||||
await this.bufferPool.clear();
|
||||
// 1. 校验全部 SSTable,移除残缺项(打开时已做一次,此处兜底运行期损坏)
|
||||
const removed = await this.lsm.validateAll();
|
||||
// v0.4.5: 清空页面缓存(损坏数据可能驻留 BufferPool,重新加载)
|
||||
await this.bufferPool.clear();
|
||||
// 2. 将 WAL 残留数据落盘并截断,避免无限重放(含空洞截断落地)
|
||||
await this.lsm.flush();
|
||||
await this.wal.checkpoint();
|
||||
|
||||
Reference in New Issue
Block a user