feat(storage): add Bitcask storage migration, binary WAL, and data compaction support

This commit is contained in:
2026-04-04 19:49:47 +00:00
parent 9e7ce25b45
commit d8a8259c73
22 changed files with 2807 additions and 412 deletions

View File

@@ -1,4 +1,5 @@
import { RustDbBridge } from '../rust-db-bridge.js';
import { StorageMigrator } from '../../ts_migration/index.js';
import type {
IOpLogEntry,
IOpLogResult,
@@ -75,6 +76,12 @@ export class SmartdbServer {
throw new Error('Server is already running');
}
// Run storage migration for file-based storage before starting Rust engine
if (this.options.storage === 'file' && this.options.storagePath) {
const migrator = new StorageMigrator(this.options.storagePath);
await migrator.run();
}
const spawned = await this.bridge.spawn();
if (!spawned) {
throw new Error(