* feat(mito2): record pending WAL tails in the region manifest
Adds `pending_tails` and `handoff_floors` to the region manifest and its
checkpoint, and an optional `pending_tails` / `handoff_floor` pair to
`RegionEdit`. An edit without them leaves the records unchanged. A floor is
dropped once the flushed entry id reaches it; a tail stays until a commit
removes it. Neither is written when empty, so manifests without them encode
as before.
Opening a region replays its WAL after this node's tails and floor, and WAL
releases at open and after a flush stay below this node's tails. Nothing
writes these records yet, so every region behaves as before.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* feat(mito2): hold back reads and region changes while WAL tails are pending
A region with pending WAL tails is missing data that only those tails hold.
Until they are recovered, scans and memtable and SST stats fail with the
retryable `RegionPendingTails` error. Truncate, entering staging, a
repartition flush, a close-time flush on request, and ALTERs other than
adding nullable columns without a default or changing options are rejected
before they change any region state. Compaction pauses. A full-listing GC
pass skips the region while it has pending tails, or while a newer manifest
may exist or the manifest listing fails.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* docs(mito2): name the WAL releases that keep pending tails
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(mito2): reject no-op ALTERs of restricted kinds while WAL tails are pending
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(mito2): check that reopening restores the pending-tail read gate
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(mito2): pin what the pending-tail fixtures and rejections promise
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* refactor(mito2): name the replay start in the open log and share the pending-tail check
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* docs(mito2): state the per-node order of pending tails and who keeps later writes out of them
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* test(mito2): check that a cancelled compaction starts nothing while WAL tails are pending
When a compaction cancelled by task id finishes, the queued manual request goes through handle_pending_compaction_request, whose pending-tails check replies Ok(0). The reply is read with try_recv so that a dispatched request fails the test at once instead of hanging it.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
* fix(mito2): drop the pending compaction task state when WAL tails skip it
Skipping a pending manual compaction while WAL tails are pending replied Ok(0) but left its task state in place, so task inspection kept listing it as queued and cancelling it by id still succeeded. Clear the pending task state and publish before replying.
Signed-off-by: jeremyhi <fengjiachun@gmail.com>
---------
Signed-off-by: jeremyhi <fengjiachun@gmail.com>