-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
persist-txn: allow data shards to be forgotten (#22475)
This is necessary to support deleting a table in mz (which requires advancing the persist shard's upper to the empty antichain). A data shard is removed from the txns set using a `forget` operation that writes a retraction of the registration update at some `forget_ts`. After this, the shard may be used through normal means, such as direct `compare_and_append` writes or tombstone-ing it. To prevent accidental misuse, the forget operation ensures that all writes to the data shard have been applied before writing the retraction. This PR also removes the restriction that a data shard must be registered to read it with a snapshot. That was added initially because it seems "obvious" (and because reads initially worked differently), but in practice it turns out to be unnecessary and the system is less brittle without the requirement. Specifically: - The information necessary to read at a given timestamp is simply whether there are any unapplied writes below it. - At times before the first registration time, there are trivially no unapplied writes. - Because the forget operation carefully ensures that all writes have been applied before writing the retraction, this stays true for _every_ register ts, including the latest one. - As a result, we always know the data shard has no unapplied writes up to the first unapplied write of the current registration (or progress_exclusive if there are none). - (This will remain true when we add compaction, because it will keep the invariant that the txns shard since is held back before every write until it's known to be applied.) Touches #22173 I think this also... Fixes #22465 ### Motivation * This PR adds a known-desirable feature.
- Loading branch information
Showing
8 changed files
with
774 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.