Skip to content

Commit 856ca33

Browse files
committed
Direct flush.
1 parent a42db40 commit 856ca33

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

modules/module-slatedb-storage/src/storage/SlateDBKVStore.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
DbBuilder,
88
DbReader,
99
DbReaderBuilder,
10-
FlushType,
1110
KeyRange,
1211
ObjectStore,
1312
Settings,
@@ -144,16 +143,7 @@ export class SlateDBKVStore implements AsyncDisposable {
144143
}
145144

146145
async flush(): Promise<void> {
147-
const batch = new WriteBatch();
148-
try {
149-
batch.put(
150-
toKeyBytes(storageKey('meta', 'durability-barrier')),
151-
encodeValue({ id: ++this.durabilityBarrierId, flushed_at: new Date().toISOString() })
152-
);
153-
await this.db.write_with_options(batch, DURABLE_WRITE_OPTIONS);
154-
} finally {
155-
batch.dispose();
156-
}
146+
await this.db.flush();
157147
}
158148

159149
scanPrefix<T = unknown>(
@@ -167,7 +157,6 @@ export class SlateDBKVStore implements AsyncDisposable {
167157
options: { name?: string; lifetimeMs?: number | bigint } = {}
168158
): Promise<CheckpointCreateResult> {
169159
await this.flush();
170-
await this.db.flush_with_options({ flush_type: FlushType.MemTable });
171160
return this.admin.create_detached_checkpoint({
172161
name: options.name,
173162
lifetime_ms: options.lifetimeMs,

0 commit comments

Comments
 (0)