Commit Graph
18 Commits
Author SHA1 Message Date
ldm0 c33d3846a0 perf(sqlite): share Tokio task machinery across storage owners
Erase async task body types at RuntimeHandle::spawn so SQLite owner loops
share Tokio scheduler code. Keep blocking SQL work and results concrete,
and retain the existing task admission, failure collection and shutdown.

This boxes each submitted async task once; normal SQL commands do not gain
an additional box. The original Linux x86_64 release profile, followed by
strip --strip-all, decreases from 111026760 to 110965320 bytes (60 KiB).

Validation: cargo fmt --all; full workspace Clippy with all targets/features
and -D warnings; Nextest 22154 passed, 20 skipped; CDP smoke 92/92 on both
Moli and actual Chrome 145.
2026-11-02 03:10:27 +08:00
ldm0 3b76d63b3a refactor(sqlite): unify writeback failure handling 2026-11-01 04:03:38 +08:00
ldm0 a598b45216 refactor(storage): remove unused persistence APIs 2026-11-01 04:03:38 +08:00
ldm0 5e50fbc145 refactor(sqlite): use FIFO flush barriers without sequence acknowledgements 2026-11-01 04:03:38 +08:00
ldm0 f1ab617cf2 refactor(storage): remove automatic SQLite writeback retries
Discard failed Cookie batches without requeueing, following Chromium's commit
behavior. Preserve the live canonical jar and the normal 30-second/512-operation
schedule for new mutations, and report persistence errors without replaying the
old batch on flush/close.

Remove backoff state, error classification, and per-call failure admission.
Retain explicit-flush recovery only for localStorage, whose absolute area
metadata must stay paired with its failed entry deltas.

Cover idle failures, subsequent batch deadlines and operation thresholds,
non-replaying flush/close, Cookie jar versus SQL state, and actual SQLITE_FULL
recovery by explicit localStorage flush.
2026-11-01 04:03:38 +08:00
ldm0 42680d286e refactor(storage): apply idempotent deltas without existence tracking
Keep the latest Put or Delete for each key rather than eliding transient-row
deletes. Remove existed from Cookie and localStorage deltas and Cookie mutation
observers, then remove the shared uncertain-commit correction hook. Preserve
Cookie Touch composition and atomic, idempotent retry behavior.

Replace optimization-specific assertions with actual SQL replay tests covering
a published put followed by deletion and clear followed by a newer put.
2026-11-01 04:03:38 +08:00
ldm0 d0a8d7ae19 fix(storage): retry recoverable SQLite writeback failures
Preserve SQLite error codes and retry atomic batches after transient resource,
locking, and I/O failures. Back off from one second to a capped sixty-second
interval without letting new mutations bypass the delay. Successful commits
restore localStorage admission; permanent errors still require explicit retry.

Verify bounded scheduling with virtual time and real SQLITE_FULL recovery
without a second flush, including restart persistence and new writes.
2026-11-01 04:03:38 +08:00
ldm0 5e6482996e feat(storage): open Cookie and localStorage databases on first use 2026-11-01 04:03:38 +08:00
ldm0 b5cf04a307 refactor(storage): switch SQLite namespaces without JSON migration 2026-11-01 04:03:38 +08:00
ldm0 6708ecf8ac feat(profile): stage and recover atomic SQLite cookie and localStorage migration 2026-11-01 04:03:38 +08:00
ldm0 03e09d240c feat(storage): add asynchronous SQLite Web Storage areas and flush barriers 2026-11-01 04:03:38 +08:00
ldm0 f802862181 refactor(indexeddb): use Tokio database owners and timed connection cleanup
Replace fixed worker shards and Lane locks with one async worker and one FIFO owner per database. Move synchronous SQL, connection work and catalog operations to the blocking pool. Drain accepted work and await final owner receipts before retirement or runtime teardown.

Use a single maintenance task with a short idle grace and at most one pending check per database, so slow owners cannot stall later rounds. Retry transient open failures in the same prepared generation while preserving terminal missing-file checks. Cover lifecycle races, low-FD creation and recovery, and single-worker host shutdown without new shared resource budgets.
2026-10-30 20:27:08 +08:00
ldm0 273ce0519d refactor(indexeddb): remove shared in-flight memory budgets 2026-10-30 03:31:32 +08:00
ldm0 d8755b9ff9 refactor(indexeddb): replace task tickets with one data byte budget 2026-10-30 03:31:32 +08:00
ldm0 c8a04cbc6f fix(indexeddb): backpressure SQL execution without retaining slots 2026-10-30 03:31:32 +08:00
ldm0 e26389031c feat(indexeddb): add fenced owner cleanup on SQL workers
Reserve bounded cleanup metadata and one control slot before fencing an owner. Close each database on its SQL lane, retire generation directories, cancel accepted factory requests and only then allow a new generation. Return logical connection retirement capacity at the native close receipt even when callers retain closed wrappers.
2026-10-30 03:31:32 +08:00
ldm0 db1a2cf378 feat(indexeddb): add bounded SQL service and atomic record writes 2026-10-30 03:31:32 +08:00
ldm0 c7ecc2e772 feat(sqlite): add bounded background executor and connection policy 2026-10-30 03:31:32 +08:00