You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MongoDB seal: non-transactional withdrawal window and conditional-append heads without a generation #49
Follow-ups found while landing the uniform v2 schema (#48). Neither loses data. Both are MongoDB-only.
A withdrawn seal marker can be seen briefly without transactions. On a deployment without multi-document transactions, a seal that loses a race with truncate_before inserts its marker, re-checks the head's truncate_epoch, and withdraws the marker with Conflict.
In that window (milliseconds), a reader can see the sealed view.
Two sealers racing one truncation in the window could leave entries dropped from a stream that never got sealed.
A rollback-free design would clip sealed reads at a durable truncation floor kept on the stream head.
Conditional-append heads lack g.append_once's head upsert, for conditional appends, creates a stream head with no g (generation) field. delete_sealed_in filters on g: 0, so it misses such heads. Retention then reports a conflict and skips the stream instead of deleting it. Fix: write $max: {g: 0} on that upsert (as the new head writes already do), or match on a missing g too.
Two MongoDB-only follow-ups from the v2 schema work: (1) without multi-document transactions, a withdrawn seal marker is briefly visible and two sealers racing a truncation can leave unsealed streams missing entries; (2) append_once's conditional-append head upsert omits the g generation field, so delete_sealed_in (which filters g: 0) misses those heads and retention skips the stream. No data loss in either case; fix (2) by writing $max: {g: 0} or matching a missing g.
Two more review findings that arrived after #48's review rounds closed (threads left open on #48):
P1, schema/runner.rs:359: reject in-place renames onto another source record. In an in-place batch, an old-schema record whose new id equals another, not-yet-migrated source record's id can overwrite it. Uniform v2 record schema (v1.0.0) #48 (comment)
P2, sqlite/src/sql/upgrade.rs:336: reject impossible RFC 3339 calendar dates (for example 2026-02-31) in the v0 backfill instead of producing a shifted instant.
Gap found in epic work (senamakel/tinyjuice#1): Step::blobs re-puts each target without an expiry, and BlobOutput cannot carry one. Blobs with a TTL (for example tinyjuice CCR originals) lose it when migrated. BlobOutput should be able to carry or preserve expires_at.
Re-checked against main after the v2 rollup (#83). (b) is fixed ($max {g:0}), and (c)-(f) are obsolete: the runner, upgrade.rs, BlobOutput and registry are all gone.
Two items remain: (a) the non-transactional seal withdrawal window (mongodb/streams.rs:1109-1133), and (g) WriteOp::Put in atomic batches takes no WriteOptions (types/document/types.rs:366-378), so batched writes record schema 0. Also: batch puts drop expires_ms too, and the facade's Mongo streams have no blob store, so seal is Unsupported. Suggest narrowing this issue to (a) + (g), and filing the seal/blob-store wiring separately.
Activity
tinysweeper commentedon Oct 16, 2026
Two MongoDB-only follow-ups from the v2 schema work: (1) without multi-document transactions, a withdrawn seal marker is briefly visible and two sealers racing a truncation can leave unsealed streams missing entries; (2) append_once's conditional-append head upsert omits the g generation field, so delete_sealed_in (which filters g: 0) misses those heads and retention skips the stream. No data loss in either case; fix (2) by writing $max: {g: 0} or matching a missing g.
Labelled
priority: p2.senamakel commentedon Oct 16, 2026
Two more review findings that arrived after #48's review rounds closed (threads left open on #48):
schema/runner.rs:359: reject in-place renames onto another source record. In an in-place batch, an old-schema record whose new id equals another, not-yet-migrated source record's id can overwrite it. Uniform v2 record schema (v1.0.0) #48 (comment)sqlite/src/sql/upgrade.rs:336: reject impossible RFC 3339 calendar dates (for example 2026-02-31) in the v0 backfill instead of producing a shifted instant.senamakel commentedon Oct 16, 2026
Gap found in epic work (senamakel/tinyjuice#1):
Step::blobsre-puts each target without an expiry, andBlobOutputcannot carry one. Blobs with a TTL (for example tinyjuice CCR originals) lose it when migrated.BlobOutputshould be able to carry or preserveexpires_at.senamakel commentedon Oct 16, 2026
Two more gaps found in epic work (senamakel/tinymcp#1):
mcp_client_env/*) can't be renamed to v2<owner>/…prefixes.WriteOp::Putinatomic_batchtakes noWriteOptions, so batched writes recordschema = 0.M3gA-Mind commentedon Nov 11, 2026
Re-checked against main after the v2 rollup (#83). (b) is fixed (
$max {g:0}), and (c)-(f) are obsolete: the runner, upgrade.rs, BlobOutput and registry are all gone.Two items remain: (a) the non-transactional seal withdrawal window (
mongodb/streams.rs:1109-1133), and (g)WriteOp::Putin atomic batches takes noWriteOptions(types/document/types.rs:366-378), so batched writes record schema 0. Also: batch puts dropexpires_mstoo, and the facade's Mongo streams have no blob store, sosealis Unsupported. Suggest narrowing this issue to (a) + (g), and filing the seal/blob-store wiring separately.fix(document): a standalone MongoDB seal is never withdrawn after rea…
feat(types)!: WriteOp::PutWith carries a put's WriteOptions into an a…
fix(facade): MongoDB streams can seal, so hosts' journal maintenance …
M3gA-Mind commentedon Nov 11, 2026
Done in three merged PRs:
WriteOp::PutWithcarries a put'sWriteOptionsinto an atomic batch, so batched puts keep their schema and expiry (item g). This is a breaking change, so the next release containing it is v3.0.0.The other items were already fixed or removed by the v2 rewrite (feat(storage): roll up TSD v2 primitives #83).