Repository navigation
fix: answer TTL and tag calls during a table's DELETING window #599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hitesh96db
merged 20 commits into
fix/505-deleting-window-answers
from
fix/551-552-deleting-window-ttl-tags
Dec 4, 2026
+1,303
−47
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ffb8f0e
fix: answer TTL and tag calls during a table's DELETING window as the…
LeeroyHannigan 705f000
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan c880756
refactor(engine): read the DELETING status once and keep one copy of …
LeeroyHannigan 8ad7b93
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan c5985c5
build(storage-mongodb): declare the engine dev-dependency by path
LeeroyHannigan 191684b
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan 8015c6d
test(storage-mongodb): move the TTL and tag window tests to their own…
LeeroyHannigan 9adeb6d
refactor(core): build the DescribeTimeToLive state refusal from one m…
LeeroyHannigan 9a35e65
test: put the window's UpdateTimeToLive rows in one data table per ba…
LeeroyHannigan 34e328a
test: retry DeleteTable after a tag write in the window tests
LeeroyHannigan a75c9cd
fix(engine): serve only the latest stream ARN of a DELETING table, an…
LeeroyHannigan 9fb240d
fix(engine): read the table status after the UpdateTimeToLive write
LeeroyHannigan 02a7a25
fix(storage-mongodb): refuse a TTL index build on a DELETING document…
LeeroyHannigan ec4c09c
docs: describe the TTL and tag calls in a table's DELETING window
LeeroyHannigan e4465ec
test(engine): drop the direct unit test of arn_storage_error
LeeroyHannigan fd12d6c
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan 992cca4
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan 7fd3aad
fix(engine): drop the TTL index of a disable whose status read failed
LeeroyHannigan 1910108
docs: the UpdateTimeToLive phase of the DELETING window
LeeroyHannigan 8831eaa
Merge fix/505-deleting-window-answers into fix/551-552-deleting-windo…
LeeroyHannigan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| // Copyright 2026 ExtendDB contributors | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| //! The catalog's lifecycle status for a table, for handlers that decide on it. | ||
| //! | ||
| //! `TableKeyInfo` carries no status, and the key-info read reports a `DELETING` | ||
| //! row as not found on MongoDB and Cassandra, so a handler that has to tell a | ||
| //! `DELETING` table from a missing one cannot get the answer from it. The | ||
| //! description carries the status on every backend, and the table's latest | ||
| //! stream ARN, which the tag path checks a stream ARN against in the window. | ||
| //! The callers (the two TTL handlers and the tag path) are control-plane | ||
| //! calls, so the read is not on a data-plane path. | ||
| //! | ||
| //! The read is `describe_table`: four catalog queries on PostgreSQL and SQLite | ||
| //! (`tables`, `indexes`, `vector_indexes`, `table_restores`) and two on MongoDB | ||
| //! and Cassandra (`tables`, `indexes`). `DescribeTimeToLive`, | ||
| //! `UpdateTimeToLive`, `TagResource`, `UntagResource` and `ListTagsOfResource` | ||
| //! each make it once per call. `DescribeTimeToLive` on an `ACTIVE` table sends | ||
| //! five and three, where it sent one. `UpdateTimeToLive` sends the four or two | ||
| //! more, after its write, and on a `DELETING` table it skips the TTL read after | ||
| //! the write and the index statements. | ||
|
|
||
| use extenddb_core::types::{DescribeTableInput, TableDescription}; | ||
| use extenddb_storage::error::StorageError; | ||
|
|
||
| use crate::OperationContext; | ||
|
|
||
| /// Read `table_name`'s catalog description, for its `table_status` and its | ||
| /// `latest_stream_arn`. | ||
| /// | ||
| /// # Errors | ||
| /// | ||
| /// Returns [`StorageError::TableNotFound`] when no catalog row exists, and | ||
| /// whatever the backend raised otherwise. The caller maps it, so each operation | ||
| /// keeps the message it already answers for a missing table. | ||
| pub(crate) async fn read_table_description( | ||
| table_name: &str, | ||
| ctx: &OperationContext, | ||
| ) -> Result<TableDescription, StorageError> { | ||
| ctx.storage | ||
| .describe_table( | ||
| &ctx.account_id, | ||
| DescribeTableInput { | ||
| table_name: table_name.to_owned(), | ||
| }, | ||
| ) | ||
| .await | ||
| } |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Measured 2026-11-20 against Amazon DynamoDB in us-east-1 and against this PR (c5985c5) on SQLite and PostgreSQL. Each table had a stream and one table tag (
k1=v1). Each request shape was sent at least twice, andDescribeTableread DELETING before and after every round quoted.ListTagsOfResource,TagResource(new keyk9) andUntagResource(absent keynokey) on the table ARN in a loop right afterDeleteTablereturned.+tis seconds afterDeleteTablereturned.k9nokeyk1ResourceInUseExceptionResourceNotFoundExceptionResourceNotFoundExceptionResourceNotFoundExceptionk1ResourceInUseExceptionk1ResourceNotFoundExceptionResourceNotFoundExceptionResourceNotFoundExceptionResourceNotFoundExceptionResourceNotFoundExceptionDescribeTableread DELETING in every row, and the table was gone at +6.0 s and +6.7 s. TheResourceNotFoundExceptiontext isRequested resource not found: ResourceArn: <arn> not found. In the same rounds the stream ARN answered 200 throughout. Three further runs gave the same shape (the flip at 0.63 s, 1.28 s to 1.91 s and 2.3 s).So the service serves the table-ARN tag calls as this comment, the PR body and the wire test describe them for the first 0.6 to 2.3 s of the window, and answers
ResourceNotFoundExceptionfor the rest. This PR serves ListTagsOfResource and refuses tag writes for the whole window. The text needs the phase, and the wire test needs to assert only the first answer afterDeleteTablereturns.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phase is now stated in the doc comment of
refuse_while_deleting(a75c9cd) and in the docstrings of the wire file and oftest_tag_changes_are_being_deleted_and_tags_are_listed(ec4c09c). The window row ofdocs/differences-from-dynamodb.mdand the PR body state it too. These answers hold for the first 0.6 to 2.3 s afterDeleteTablereturns, and then the service answersResourceNotFoundException.The wire tests assert the first answer after
DeleteTable. ExtendDB keeps the first answers for the whole window, and that is filed as #1456 with your runs.