Repository navigation
fix(engine): describe a DELETING table with the members the service keeps - #1411
Conversation
…eeps While a table is DELETING, DeleteTable's 200 and DescribeTable on the service carry no KeySchema, AttributeDefinitions, CreationDateTime, WarmThroughput, GlobalSecondaryIndexes, LocalSecondaryIndexes or VectorIndexes. ExtendDB sent all of them on every backend, and DeleteTable on Cassandra sent TableStatus ACTIVE, the status the row had before the delete. The service keeps TableName, TableArn, TableId, TableStatus, TableSizeBytes, ItemCount, ProvisionedThroughput, DeletionProtectionEnabled and, when the table has them, BillingModeSummary, TableThroughputModeSummary, TableClassSummary, SSEDescription, OnDemandThroughput, StreamSpecification, LatestStreamArn and LatestStreamLabel. Measured in us-east-1 on 2026-11-23 on on-demand and provisioned tables, with and without a GSI, an LSI, a vector index, a stream, a table class, KMS encryption and an on-demand throughput cap, at least twice each. TableDescription::prepare_for_response, which every path that returns a description runs, now empties those members for a DELETING table, and the three that are not optional skip serialisation when empty or zero. handle_delete_table sets the status to DELETING before it, so a backend that read the row before the delete answers as the others do. Later in the window the service sends less: first without StreamSpecification, then only ItemCount, ProvisionedThroughput, TableArn, TableName, TableSizeBytes and TableStatus. Neither stage is reproduced; the new row of docs/differences-from-dynamodb.md says so. The tests that asserted a KeySchema in a DELETING answer lose that assertion. Built on SQLite, PostgreSQL and MongoDB, the member sets of DeleteTable's answer equal the service's for each of those tables. Closes #602 Signed-off-by: Hitesh Sharma <hts@amazon.com>
LJMart11
left a comment
There was a problem hiding this comment.
Reviewed at 713cb5f. 1 finding: 1 Docs.
The change empties KeySchema, AttributeDefinitions, CreationDateTime, WarmThroughput and the three index lists from a DELETING table's description, and makes DeleteTable answer DELETING on every backend. Confirmed: DeleteTable's answer carries the same member set as Amazon DynamoDB's raw response for an on-demand table with a GSI and an LSI (10 members) and for a provisioned table with a stream and a table class (12 members), on PostgreSQL, SQLite and Cassandra. On Cassandra, which the description did not run, both answers say DELETING. Putting the base's prepare_for_response back fails a_deleting_description_omits_the_members_the_service_drops and a_description_read_before_the_delete_answers_as_deleting, and restoring the base KeySchema serde attribute fails the first of these. The head merged with the current main builds, and the core (1242) and engine (979) lib tests pass on the merged tree. The PR's counts of 1147 core and 872 engine lib tests match the head. tests/test_table_operations.py passes on PostgreSQL and SQLite (30 each). Its DeleteTable tests pass on Cassandra (5 passed, 2 skipped).
- Docs
tests/test_table_operations.py:190— The docstring says a second DeleteTable on a DELETING table succeeds 'as the service does', but the service answered 400 ResourceInUseException in 2 of 2 runs, anddocs/differences-from-dynamodb.mddoes not list the divergence.
Docs — outside the diff
tests/test_table_operations.py:190
Docs
This docstring says a second DeleteTable on a DELETING table returns its description with no error "as the service does". The service refuses it. storage-postgres/src/delete_table.rs:77 and storage-sqlite/src/delete_table.rs:38 answer 200 by design. docs/differences-from-dynamodb.md has no row for this case, and tests/test_table_operations.py:201-204 asserts a 200 the service never sends. This comes from main, not from the change.
Fix: answer ResourceInUseException at those two branches. Alternatively, add a differences row and correct this docstring and the comment at delete_table.rs:44. Either way, :201-204 changes. I can't tell whether following the API reference over the service is deliberate.
Evidence: on Amazon DynamoDB (us-east-1), a second DeleteTable right after the first answered 400 ResourceInUseException: Attempt to change a resource which is still in use: Table is being deleted: <name> (2 of 2). https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html says "If table is already in the DELETING state, no error is returned."
A second DeleteTable on a table that is already DELETING answered 200
with the table's description on PostgreSQL and SQLite, following the
API reference ("no error is returned"). Amazon DynamoDB refuses it:
400 ResourceInUseException "Attempt to change a resource which is
still in use: Table is being deleted: <name>" (measured 2026-11-30 in
us-east-1, 3 of 3 calls; the review of #1411 measured 2 of 2).
Both backends now answer that refusal and change nothing; the control
plane still finishes the delete. MongoDB keeps finishing a delete that
an earlier DeleteTable left DELETING, since it has no worker that
would; Cassandra never leaves a table DELETING. The differences doc
gets a row for both.
The pytest and the PostgreSQL storage tests that expected the 200 now
expect the refusal, and the table fixture's teardown waits out a table
the test already deleted instead of waiting for it to turn ACTIVE.
Signed-off-by: Hitesh Sharma <hts@amazon.com>
|
@LJMart11 thanks, the finding is correct. Fixed in 673ccae with option (a). Measured 2026-11-30 against Amazon DynamoDB in us-east-1 (on-demand table with a string
What changed
Tests run
The upgrade manual has no entry for #602. v1.1.0 is already tagged, and its release PR (#1514) wrote that release's behavior-change entries, so I added none here. |
LJMart11
left a comment
There was a problem hiding this comment.
Checked at 673ccae against the list from 713cb5f. 3 findings: 1 Important, 1 Docs, 1 Nit.
Since the last round, PostgreSQL and SQLite refuse a second DeleteTable on a DELETING table with the service's ResourceInUseException, and the tests and differences row are updated to match. The earlier docstring finding is fixed. test_delete_of_a_deleting_table_is_refused passes against Amazon DynamoDB (4 deleting-path tests) and on PostgreSQL and SQLite (tests/test_table_operations.py, 30 each). On PostgreSQL, 10 concurrent DeleteTables on one table answered one 200 and nine 400 ResourceInUseException in 3 of 3 trials at a 5 s control-plane delay, the same split the service gave in 3 of 3. Putting the base's PostgreSQL branch back, or removing it, fails delete_table_of_a_deleting_table_is_refused on both layouts and an_open_held_with_deletes_queued_completes::separate_data_database. table_snapshot passes single-threaded at the head (94 passed, 2 ignored), matching the author's count.
Previous items: 1 fixed.
- Important
crates/storage-sqlite/src/delete_table.rs:28— This hunk no longer merges with main: #1166 wrapped both queries insqlx::AssertSqlSafefor sqlx 0.9.1, and the new commit edits the same lines. - Nit
crates/storage-sqlite/src/delete_table.rs:39— On SQLite the new DELETING refusal reads the row before the write lock, so concurrent DeleteTables all pass it and answer 200 where the service and PostgreSQL refuse all but one. - Docs
docs/manuals/07-upgrade-manual.md:385— After an upgrade from v1.1.0, a second DeleteTable on a DELETING PostgreSQL or SQLite table gets 400 where it got 200, and the DeleteTable answer loses KeySchema and six other members, but Behavior Changes by Release has no entry.
Required — outside the diff
crates/storage-sqlite/src/delete_table.rs:28
Important
This comes from main moving, not from the change. #1166 (a20e12e) moved the SQLite crate to sqlx 0.9.1 and wrapped the row query at delete_table.rs:28 and the index query in the old DELETING branch in sqlx::AssertSqlSafe(...). 673ccae edits the same two places, so git merge of this head into main 222d80a6 stops with a content conflict in this file. Round 1's head merged cleanly.
Fix: rebase onto main. Keep this head's comment and refusal, and keep main's sqlx::query_as(sqlx::AssertSqlSafe(format!(...))) on the row query. The old index query goes away with the DELETING branch. No test changes.
Evidence: git merge --no-edit 673ccaee on origin/main (222d80a) gives CONFLICT (content): Merge conflict in crates/storage-sqlite/src/delete_table.rs (two hunks: the row query at :28 and the DELETING branch at :39). With the resolution above, cargo check --tests -p extenddb-storage-postgres -p extenddb-storage-sqlite under 1.94.0 is clean. cargo test -p extenddb-storage-sqlite passes on the merged tree (335 lib passed, 1 ignored, plus 1, 1 and 3 integration).
Docs — outside the diff
docs/manuals/07-upgrade-manual.md:385
Docs
After an upgrade from v1.1.0, client-visible behaviour changes in two ways, and Behavior Changes by Release (07-upgrade-manual.md:385) has no entry for either. First, a DeleteTable on a DELETING PostgreSQL or SQLite table answers 400 ResourceInUseException where v1.1.0 answered 200. Second, DeleteTable's answer and a DELETING DescribeTable drop KeySchema, AttributeDefinitions, CreationDateTime and four other members. A client that read KeySchema from the answer, or a retry loop that treated a second 200 as done, behaves differently.
The reply says release PRs write these entries. On main, #1349 (5f8cdf1), #1523 (5026c89) and #1449 (2a820be) each added their own entry before #1514 bumped the version.
Fix: add an entry for the next release under that heading naming both changes. No migration or config step.
Evidence: on this head's PostgreSQL and SQLite harness servers, the second DeleteTable answered 400 ResourceInUseException: Attempt to change a resource which is still in use: Table is being deleted: <name>. git show 5f8cdf10 5026c891 2a820be6 -- docs/manuals/07-upgrade-manual.md shows each adding a ### v1.1.0: … or ### IAM: … entry.
Optional — outside the diff
crates/storage-sqlite/src/delete_table.rs:39
Nit
On SQLite, the DELETING check at delete_table.rs:39 tests a row read at :28 before write_lock and BEGIN IMMEDIATE (:143). Concurrent DeleteTables all see ACTIVE, pass the check, and answer 200, because the UPDATE at :155 ignores the status. PostgreSQL reads FOR UPDATE and refuses all but one.
Fix: add AND table_status <> 'DELETING' to the UPDATE at :155, refuse when rows_affected() == 0, and do the same for the DELETE at :119.
Evidence: 10 concurrent DeleteTables on one table, 3 trials, delay 5 s. DynamoDB and PostgreSQL gave 1×200 + 9×400 ResourceInUseException in 3 of 3. SQLite gave 10×200 in 2 of 3 and 6×200 + 4×400 in 1.
Resolve the conflict in crates/storage-sqlite/src/delete_table.rs: keep this branch's DELETING refusal and comment, and main's sqlx::AssertSqlSafe wrapper (#1166) on the row query. The old DELETING-branch index query is gone with the branch. Signed-off-by: Hitesh Sharma <hts@amazon.com>
…ite lock The DELETING refusal tested a row read before the write lock, so concurrent DeleteTables on one table all saw ACTIVE and all answered 200, where DynamoDB and PostgreSQL refuse all but one. Re-read the status inside the BEGIN IMMEDIATE transaction: a DELETING table is refused, and a table another call already removed is TableNotFound. Two tests run ten DeleteTables at once, with and without a control-plane delay, and fail without the check (ten successes). Signed-off-by: Hitesh Sharma <hts@amazon.com>
List the two client-visible changes from v1.1.0 under Behavior Changes by Release: a second DeleteTable on a DELETING PostgreSQL or SQLite table answers 400 ResourceInUseException, and DeleteTable's answer and a DELETING DescribeTable drop seven members. Signed-off-by: Hitesh Sharma <hts@amazon.com>
|
Addressed the three findings from the review at 673ccae. New head: 88d4579. 1. Important: conflict in 2. Nit: SQLite DELETING check ran before the write lock. Verified. eb6f913 adds
3. Docs. 88d4579 adds an entry under Behavior Changes by Release in Tests run (local, 127.0.0.1 only, throwaway servers and databases removed afterwards; no AWS calls):
Not run: |
|
Checked at Fixed:
Disputed: none. Needs-human:
|
The parity corpus from #1009 checked that DeleteTable's answer carries the table's WarmThroughput. This change drops WarmThroughput from a DELETING description, as the service does, so the case now checks that the member is absent. Signed-off-by: Hitesh Sharma <hts@amazon.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks. I read the change against main 92155f3. The member drop matches the service. On 2 December I deleted three PROVISIONED tables with a NEW_AND_OLD_IMAGES stream and the STANDARD_INFREQUENT_ACCESS class in us-east-1. DeleteTable's answer, and a DescribeTable right after it, carried the 12 members this PR keeps, and no BillingModeSummary, which the ACTIVE description did not carry either. That first set lasted 3.7 to 5.8 s, so the dual-target test's one DescribeTable after DeleteTable lands in it. At this head the engine, SQLite and PostgreSQL table_snapshot tests passed (1, 3 and 94), and so did the native run of the wasm parity corpus. Against servers built from this branch and from main, the four new or renamed cells of tests/test_table_operations.py failed on main and passed here. CI passed, and the branch merges with main.
The refusal of a second DeleteTable on SQLite and PostgreSQL gives the measured answer. #550 (opened 25 October) makes the same refusal, with the sentence built once as ErrorMessageKey::TableBeingDeleted. It also changes the same lines of crates/engine/src/delete_table.rs, of both backends' delete_table.rs, table_snapshot.rs, conftest.py, test_table_operations.py and docs/differences-from-dynamodb.md. Under code-size.md, the second of the two PRs to merge drops its copy of the refusal. No other PR has the member drop.
This needs three changes before it merges, all in the text that this PR adds to the docs:
- The upgrade entry's heading is
### After v1.1.0:. A change that makes ExtendDB answer as DynamoDB does ships in a minor release, so the heading is### v1.2.0:, the rename your comment asks for. - The entry and the differences row say that when several DeleteTable calls run at once, the others answer the 400. With a
control_plane_delay_secondsbelow 1 (the default is 0.25), SQLite drops the table in the first call, and the others answerResourceNotFoundException, asconcurrent_immediate_deletes_let_exactly_one_throughasserts. - Both say that Cassandra never leaves a table
DELETING.abandon_restore_targetandclaim_registered_target_for_removalincrates/storage-cassandra/src/backup_engine.rsset a failed restore targetDELETINGwhile the reconciler deletes it, and a DeleteTable in that window answers 200 at this head.
The inline comments are smaller.
The description covers the first commit only. It does not mention the refusal, the SQLite check under the write lock or the conftest change. It says that the test this PR renames to test_delete_of_a_deleting_table_is_refused loses its KeySchema assertion, and its core and engine counts are from 713cb5f.
|
|
||
| /// The service's refusal of DeleteTable on a DELETING table (measured | ||
| /// 2026-11-30). | ||
| fn deleting_refusal(table_name: &str) -> StorageError { |
There was a problem hiding this comment.
This PR builds the sentence here and again in crates/storage-postgres/src/delete_table.rs (line 76). One builder, for example a message key in crates/core/src/error/messages.rs, would serve both backends.
There was a problem hiding this comment.
Done in 032d183. ErrorMessageKey::TableBeingDeleted in crates/core/src/error/messages.rs builds the sentence, with the name and text #550 uses, and both crates/storage-sqlite/src/delete_table.rs (deleting_refusal) and crates/storage-postgres/src/delete_table.rs call error_message(ErrorMessageKey::TableBeingDeleted, ...). SQLite tests (340) and PostgreSQL table_snapshot (94) pass.
| #[serde( | ||
| rename = "CreationDateTime", | ||
| default, | ||
| skip_serializing_if = "is_zero_seconds" |
There was a problem hiding this comment.
skip_serializing_if = "is_zero_seconds" applies to every status. So an ACTIVE table whose stored creation time a backend could not read now omits CreationDateTime, where it sent 0.0 before. The service always sends the member for an ACTIVE table. Either keep the omission to DELETING, for example with an Option<f64> that prepare_for_response sets to None, or say in the description that this case changes on purpose.
There was a problem hiding this comment.
Done in ef94866: CreationDateTime is now Option<f64> with skip_serializing_if = "Option::is_none", and prepare_for_response sets it to None only for a DELETING table. The backends build it as Some(..), so an ACTIVE table whose stored time could not be read sends 0.0 as before. The two readers that need a number (snapshot.rs and Cassandra's backup claim) take unwrap_or(0.0), the value they read before. The round-trip assertion in a_deleting_description_omits_the_members_the_service_drops now checks is_none(); core lib 1243 passed, engine lib 979 passed.
| DeleteTable's answer. | ||
|
|
||
| On ExtendDB the DELETING state is written into the catalog directly | ||
| (see test_delete_of_a_deleting_table_returns_its_description), so the |
There was a problem hiding this comment.
The docstring points at test_delete_of_a_deleting_table_returns_its_description, which this PR renames to test_delete_of_a_deleting_table_is_refused.
There was a problem hiding this comment.
Fixed in 50c72b7: the docstring now points at test_delete_of_a_deleting_table_is_refused.
| # and without indexes, a stream, a table class, KMS encryption and an | ||
| # on-demand throughput cap). boto3 hides TableThroughputModeSummary, so it | ||
| # is not named here. | ||
| DROPPED_WHILE_DELETING = ( |
There was a problem hiding this comment.
Nit: DROPPED_WHILE_DELETING lists six of the seven members that prepare_for_response drops, and leaves out VectorIndexes. Add it, or say in the comment that no test shape has a vector index.
There was a problem hiding this comment.
Added in 50c72b7, with a comment that no shape has a vector index, so the core unit test is what covers its removal.
| self._assert_deleting_shape(described["Table"], unique_table_name, extra_kept) | ||
| wait_for_deleted(dynamodb_client, unique_table_name) | ||
| return | ||
| backend = configured_backend() or ( |
There was a problem hiding this comment.
Nit: this repeats the backend detection at line 206. One helper would serve both tests.
There was a problem hiding this comment.
Done in 50c72b7: both tests call _deleting_catalog_backend(), which returns the backend or skips. Both ran (not skipped) on SQLite and PostgreSQL: 30 passed on each.
Signed-off-by: Hitesh Sharma <hts@amazon.com>
Add ErrorMessageKey::TableBeingDeleted (the name #550 uses) and build the refusal of a second DeleteTable from it on PostgreSQL and SQLite. Signed-off-by: Hitesh Sharma <hts@amazon.com>
Main is at c8e66fb, six commits past 01556cf: #481, #1137, #1403, #1465, #1515 and #1411. #1403 and #1411 add v1.2.0 entries at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, where the entry of this branch goes next. The merge has no conflict. Git merged crates/core/src/types/table.rs and crates/engine/src/lib.rs at other lines. In table.rs, main changes the members of a DELETING table in TableDescription, and this branch adds the ReplicaUpdates member of UpdateTableInput. In lib.rs, main declares a test module, and this branch declares nested_enums and adds enum_constraint. The lines that this branch changes are the same before and after the merge.
The base merges main at c8e66fb, which brings #481, #1137, #1403, #1465, #1515 and #1411, and adds the v1.2.0 entries of #1110 and #1114 to docs/manuals/07-upgrade-manual.md. The merge has no conflict. Git merged two files at other lines. In crates/core/src/types/table.rs, main changes the members of a DELETING table in TableDescription, and this branch changes the doc comment of the SSESpecification member of UpdateTableInput. In crates/storage-mongodb/src/table_engine.rs, main makes the creation time of a table description optional, and this branch records the specification in update_table.
Main is at c8e66fb, three commits past e8b5f10: #1465, #1515 and #1411. #1411 adds a v1.2.0 entry at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the entry of #606. Git merged the file with no conflict, so the order is #1411, #606, then the entry of this branch. No other file has changes on both sides.
The base brings main at c8e66fb through #1260, with #1465, #1515 and #1411, and adds the v1.2.0 entry of #1313 to docs/manuals/07-upgrade-manual.md. Git merged the manual with no conflict. The order of the v1.2.0 entries is #1313, #1411, #606, #1260, then the entry of this branch. No other file has changes on both sides.
Main is at c8e66fb. This branch last had main at 3534c9e. Since then, 42 PRs merged into main, #1482 among them, which fixes the WebAssembly build. Seven files conflicted. The merge keeps both sides in each: - crates/core/src/settings_keys.rs: #1449 adds the search_inequality_filters keys where this branch adds the GSI phase hold key. Both blocks stay, the hold first. - crates/app/src/cmd_settings.rs: #1449 imports server_setting_default and this branch imports writable_key_validator from the same module. The import names both. - crates/server/src/management/ops_settings.rs: #1449 adds the search_tests module where this branch adds its tests module. Both stay. - crates/storage-mongodb/src/lib.rs: #486 adds mod error_class where this branch adds its two GSI modules. All three stay. - crates/storage-postgres/src/delete_table.rs: #1411 refuses a table that is already DELETING before the indexes are read, where this branch built its description with the backfill set. The merge keeps the refusal of #1411 and reads the backfill set after it, before the index rows, as this branch does. - crates/storage-sqlite/src/delete_table.rs: the same change of #1411. The second hunk keeps the backfill set before the index rows and the sqlx::AssertSqlSafe query of #1166. - crates/storage-sqlite/src/table_helpers.rs: the backfill set before the catalog rows, and the sqlx::AssertSqlSafe query of #1166.
Main is at c057660. This branch last had main at b3510a9. Since then, #1411 and #1446 merged into main. One file conflicted: crates/storage-mongodb/src/data_engine_live_tests.rs. #1446 declares its delete_table test module where this branch declares put_race and contention. The merge keeps all three, main's first. Git merged docs/differences-from-dynamodb.md and the upgrade manual at other lines.
The merged branch holds main at c057660 and the #1093 change that decides the UPDATING window in each backend write. Six files conflicted. - crates/engine/src/delete_table.rs: main's #1411 builds the answer with deleting_description, and this branch clears LastIncreaseDateTime after prepare_for_response. The merge clears the member on the description that deleting_description returns. - crates/storage-sqlite/src/table_helpers.rs: the status now goes through parse_transition_at of #1093, with the one clock read of this branch. Both new tests stay. - crates/storage-sqlite/src/update_table.rs and crates/storage-postgres/src/update_table.rs: the locked SELECT reads the columns of both sides. The NoOp check and the stored units of StoredCapacity come from the TableThroughputRecord that this branch parses. The window refusal comes first, then updating_until, which now opens only when enters_updating is true for the stored values. On SQLite, main's stream decision of #963 follows them. - crates/storage-cassandra/src/update_table.rs: the stored billing mode has one name, stored_bm, and updating_until follows the same rule. - crates/storage-mongodb/src/table_engine.rs: the imports of both sides, and updating_until follows the same rule. The engine test that #1093 adds calls provisioned_5, which this branch renamed. The merge calls provisioned(5, 5).
Main is at c057660, 43 commits after the last merge. Thirteen files conflicted. Main's #1411 and #1446 change the same DeleteTable paths as this branch, so the merge keeps one copy of each check. #1411 refuses a second DeleteTable of a DELETING table on PostgreSQL and SQLite with StorageError::IndexesInUse and the TableBeingDeleted message. This branch refuses it with StorageError::TableBeingDeleted, which UpdateTable, MongoDB and Cassandra also raise. The merge keeps that variant, removes the second check that git placed after it in crates/storage-postgres/src/delete_table.rs, and removes deleting_refusal from crates/storage-sqlite/src/delete_table.rs. On SQLite, #1411 also re-reads the status under the write lock (refuse_if_deleting_or_gone). This branch reads the row inside the BEGIN IMMEDIATE transaction under the same lock, so the re-read goes. #1411's two concurrent DeleteTable tests stay, in one test module with this branch's tests, and expect TableBeingDeleted. #1446 removes a MongoDB table's tags and catalog document in one transaction keyed on the table id (delete_tags_and_table_doc). This branch does the same in remove_deleting_document, which the control plane also runs. The merge keeps the branch's function and adds #1446's note on aws:ResourceTag to its comment. The live test live_delete_table_keeps_tags_while_deleting finishes its stopped DeleteTable with finish_table_delete, because this branch refuses a second DeleteTable. Other conflicts: the doc comment of ErrorMessageKey::TableBeingDeleted names both measurement dates. crates/engine/src/delete_table.rs keeps the key-info drop before the storage call with #1411's deleting_description, and one test module. The engine test uses main's crate::test_context, so crates/engine/src/partiql/test_context.rs is main's. In put_item.rs, delete_item.rs and update_item.rs the queries take main's AssertSqlSafe and keep this branch's db_error. In table_snapshot.rs, conftest.py and test_table_operations.py main's test names and helpers stay, with the TableBeingDeleted variant. In docs/differences-from-dynamodb.md both rows stay. #1411's row now says that MongoDB and Cassandra refuse a second DeleteTable too. sqlx 0.9.1 (#1166) refuses a query string built at run time. Eight of this branch's queries now take AssertSqlSafe: two in ddl.rs (table_key_info and the status check) and six in the window tests.
Several texts said that the service serves the data plane until the table is gone. They are the differences row, the key-info comments in both ddl.rs files, and the headers of the window tests. The service serves it for the first part of the window only. Single-item reads and writes, Query and Scan are served for the first 2.7 to 5.7 s of a 6.4 to 8.1 s window. The batch, transaction and PartiQL calls are served for the first 0.5 to 2.1 s. After that the service answers ResourceNotFoundException while DescribeTable still reads DELETING (measured 2026-11-27). Each text now says so, and that ExtendDB serves the whole window. The upgrade manual gets a v1.2.0 entry for the window's answers. #1411's v1.2.0 entry said that MongoDB and Cassandra answer a second DeleteTable of a DELETING table with 200. They refuse it with this branch, and the sentence now points to the new entry.
Main is at c057660, 35 commits after the last merge (80490c6). Three files conflicted. crates/engine/src/expression_helpers.rs: #1449 moved check_expression_size from this file to crates/core/src/expression/kind.rs. This branch adds check_expression_size_with, which takes the length suffix from the caller, and check_expression_size calls it. The merge puts check_expression_size_with in kind.rs beside check_expression_size, which now calls it, and exports it from extenddb_core::expression. The engine copies of both functions go, so the size check and its message stay in one place. The import list is the list of this branch with the two size checks added. crates/core/src/expression/mod.rs: in the module list, #1449 adds search_filter and search_params, and this branch adds semantics. The merge keeps all three in name order. docs/differences-from-dynamodb.md: this branch adds the row on a table ARN in TableName, and #1411 adds two rows on a DELETING table at the same place. The merge keeps the three rows. Git merged 13 other files that both sides change, with no overlap. In crates/engine/src/query.rs, #481 adds the key size check and moves the Select index check after the ExclusiveStartKey checks. Both checks come after the request-stage checks and the table lookup of this branch. In core, the other files are crates/core/src/expression/evaluator.rs and its tests, and crates/core/src/validation/mod.rs. In the engine, they are crates/engine/src/lib.rs, crates/engine/src/partiql/mod.rs and the two transaction files. In the storage crates, they are crates/storage-cassandra/src/backup_engine.rs, crates/storage-mongodb/src/table_engine.rs, the ddl.rs files of the PostgreSQL and SQLite crates, and crates/storage-sqlite/src/data/query_scan.rs.
Main is at b6c8595, three commits past c8e66fb: #1446, #1531 and #1466. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior Changes by Release" in docs/manuals/07-upgrade-manual.md, above the entry of #1411. Git merged the file with no conflict. The order is #1531, #1446, #1411, #606, then the entry of this branch, which does not change. No other file has changes on both sides.
The base merges main at b6c8595, which brings #1446, #1531 and #1466. The base also adds 15 rows to tests/test_binary_base64.py. One file conflicted: docs/manuals/07-upgrade-manual.md. #1446 and #1531 add two v1.2.0 entries at the top of "Behavior Changes by Release", where this branch adds its entry. The merge keeps the three entries: the two entries of main first, then the entry of this branch, above the entry of #1411. Git merged tests/test_binary_base64.py at other lines. It holds the new rows of the base and the rows of this branch. No other file has changes on both sides.
…text corrections) Text only; the code is that of revision 11 (private main 5e58bea, same tree as 71939c0). - The 444 "acknowledged while staged" probes are relabelled: staged meant other keys of the kill transaction, not the probed item. The probes did not test writes on the item's own staged change; that stays open under rows 4.4 and 15 (b), with a designed, not yet run, test. - A different double equal to the pre-commit value can let the settle pass early. - float_roundtrip: Cargo.toml line under [dependencies], cargo tree -e normal,features -i serde_json, kv_get read path. - One-ulp test named; lost lease insert added as a fourth difference in row 4.1; full-suite item moved out of "Not run live"; upstream ExtendDB#1411 and ExtendDB#1087 noted (test_table_operations.py, test_scan_segments.py); same-lease-id clause in 4.4 (d). Signed-off-by: Raju Suravarjjala <raju@couchbase.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Main is at 1e2ebdd, eight commits past 5826e1b: #768, #1296, #1485, #1228, #1325, #1443, #1269 and the squash commit of #1093. Three files conflicted, in four hunks. In each hunk the UpdateTable window of #1093 meets the answer of this branch for a DELETING table: - crates/storage-postgres/src/update_table.rs and crates/storage-sqlite/src/update_table.rs have one hunk each. #1093 reads three more columns of the table row: the stored throughput, the table class and the window (in_window on PostgreSQL, stored_transition_at on SQLite). This branch answers a DELETING table with TableBeingDeleted right after UpdateTable reads the row. The merge keeps the wider read of #1093, then the DELETING check of this branch, then the check for a status other than ACTIVE. The window checks of #1093 come after that check, as on main. - crates/storage-mongodb/src/table_engine.rs has two hunks, both in require_active_table. #1093 makes the function return the catalog document of the table, and UpdateTable reads the window from it. This branch answers DELETING with TableBeingDeleted in a match on the status. The merge keeps that match, and its ACTIVE arm returns the document. The doc comment names the document and the three answers. A table has one stored status. #1093 reports UPDATING only for a stored ACTIVE table whose status_transition_at is later than now (reported_status in crates/storage/src/util/mod.rs). So no table is UPDATING and DELETING at the same time, and the merge does not choose between the two answers. Git merged six other files of this branch with no conflict: - crates/engine/src/update_table.rs: #1093 changes the doc comment of handle_update_table and declares the status_tests module. This branch maps TableBeingDeleted in update_table_err_to_dynamo. - crates/storage-cassandra/src/update_table.rs: #1093 reads status_transition_at and adds the window. This branch adds the same DELETING check before the check for a status other than ACTIVE. - crates/storage-postgres/tests/table_snapshot.rs: #1093 writes CREATING instead of UPDATING in two fixtures. This branch changes other tests. - crates/storage/src/error.rs: #1093 adds a sentence to the doc comment of IndexesInUse, and this branch adds TableBeingDeleted. - docs/differences-from-dynamodb.md: #1443 changes the default delay to 0.25 s, and #1093 changes the row on stream disable and the row of the delay setting. This branch adds the row on requests during a DELETING window. - docs/manuals/07-upgrade-manual.md: #1093 adds its v1.2.0 entry at the top of "Behavior Changes by Release". The entry of this branch stays after the v1.2.0 entries of main. The change of this branch to the entry of #1411 stays too.
What
Two answers for a table that is DELETING change to the ones Amazon DynamoDB gives.
DeleteTable's answer on every backend, andDescribeTableof a DELETING table, now carry the members the service carries. The service drops seven members while the table is DELETING:KeySchema,AttributeDefinitions,CreationDateTime,WarmThroughput,GlobalSecondaryIndexes,LocalSecondaryIndexesandVectorIndexes. It keepsTableName,TableArn,TableId,TableStatus,TableSizeBytes,ItemCount,ProvisionedThroughput,DeletionProtectionEnabledand, when the table has them,BillingModeSummary,TableThroughputModeSummary,TableClassSummary,SSEDescription,OnDemandThroughput,StreamSpecification,LatestStreamArnandLatestStreamLabel. ExtendDB sent all of them. Cassandra also answeredDeleteTablewithTableStatusACTIVE, the status the row had before the delete.DeleteTable. On PostgreSQL and SQLite, aDeleteTableof a table that is already DELETING answered 200 with its description, following the API reference ("no error is returned"). The service answers 400ResourceInUseException,Attempt to change a resource which is still in use: Table is being deleted: <name>(measured 2026-11-30 in us-east-1, 3 of 3 calls). Both backends now answer that and change nothing; the control plane still finishes the delete. The sentence is built once, fromErrorMessageKey::TableBeingDeletedincrates/core/src/error/messages.rs.How it works:
TableDescription::prepare_for_response, which every path that returns a description runs, emptiesKeySchemaandAttributeDefinitions, setsCreationDateTimetoNoneand clears the other four when the status is DELETING.KeySchemaandAttributeDefinitionsskip serialisation when empty.CreationDateTimeis nowOption<f64>and skips serialisation only whenNone, so every other status sends it as before, 0.0 included when a backend could not read the stored time.handle_delete_tablesets the status to DELETING before it runsprepare_for_response, so a backend that read the row before the delete answers as the others do.SELECT ... FOR UPDATE. SQLite re-reads the status inside theBEGIN IMMEDIATEtransaction, under the write lock: checked before the lock, ten concurrentDeleteTablecalls all saw ACTIVE and all answered 200. Now a DELETING table is refused and a table another call already removed isResourceNotFoundException.create_and_cleanup_tablefixture intests/conftest.pyno longer waits for ACTIVE when its teardownDeleteTableis refused withTable is being deleted(a table the test already deleted); it only waits for the table to go.When several
DeleteTablecalls on one table run at once, one answers 200. With acontrol_plane_delay_secondsbelow 1 (the default is 0.25), SQLite, and PostgreSQL with one shared database when no reader holds the table, remove the table in that first call, so the others answerResourceNotFoundException(concurrent_immediate_deletes_let_exactly_one_through). Otherwise the table is DELETING and the others answer the 400 (concurrent_deletes_of_one_table_let_exactly_one_through).MongoDB and Cassandra keep answering 200. MongoDB has no worker that finishes a delete an earlier
DeleteTableleft DELETING, so the nextDeleteTablefinishes it. Cassandra holds a table DELETING only when it is a restore target whose restore failed (abandon_restore_targetandclaim_registered_target_for_removalincrates/storage-cassandra/src/backup_engine.rs), while the restore reconciler removes it, and aDeleteTablein that window removes it and answers 200.docs/differences-from-dynamodb.mdstates both, and a### v1.2.0:entry indocs/manuals/07-upgrade-manual.mdcovers the two changes.Later in the window the service sends less: first without
StreamSpecification, then onlyItemCount,ProvisionedThroughput,TableArn,TableName,TableSizeBytesandTableStatus. Those two stages are not reproduced; the differences doc says so.Why
Closes #602. A client that reads
KeySchemafrom aDeleteTableanswer works against ExtendDB and fails against the service, and a retry loop that expects a second 200 fromDeleteTablegets a 400 from the service.The issue is incomplete in two places. It lists four dropped members and the service drops seven, and it lists
TableThroughputModeSummaryas dropped where the service keeps it. The measurement behind that line used an SDK that does not model the member, so the SDK hid it.Measured against Amazon DynamoDB in us-east-1 on 2026-11-23, with the raw response bodies, at least twice for each table:
BillingModeSummary,DeletionProtectionEnabled,ItemCount,ProvisionedThroughput,TableArn,TableId,TableName,TableSizeBytes,TableStatus,TableThroughputModeSummaryDeletionProtectionEnabled,ItemCount,LatestStreamArn,LatestStreamLabel,ProvisionedThroughput,StreamSpecification,TableArn,TableClassSummary,TableId,TableName,TableSizeBytes,TableStatusOnDemandThroughputandSSEDescriptionVectorIndexesTesting done
At 50c72b7 (main 1be1012 merged in):
cargo test -p extenddb-core --lib: 1243 passed, 1 ignored.a_deleting_description_omits_the_members_the_service_dropsholds a description with every member, on-demand and provisioned, and checks the DELETING, ACTIVE, UPDATING and CREATING shapes and a round trip throughDeserialize.cargo test -p extenddb-engine --lib: 979 passed.a_description_read_before_the_delete_answers_as_deletingfails when the status line ofdeleting_descriptionis removed.cargo test -p extenddb-storage-sqlite: 340 passed in 5 binaries, including the two concurrency tests, which fail without the check under the write lock (ten successes).table_snapshot(--test-threads=1, local PostgreSQL): 94 passed, 2 ignored.cargo test --locked -p extenddb-wasm-adapter --test parity(native): passed.tests/test_table_operations.pyagainst throwaway servers on 127.0.0.1 built from this branch: 30 passed on SQLite and 30 passed on PostgreSQL, none skipped.cargo fmt --all -- --checkis clean.cargo +1.97.0 clippy --all-targets -- -D warningsis clean onextenddb-engine,extenddb-storage,extenddb-storage-postgres,extenddb-storage-sqlite,extenddb-storage-mongodbandextenddb-storage-cassandra, and onextenddb-core --libin the test profile.extenddb-core'sdata_file_decode_peakintegration test has an unused variable off Linux that is on main already.test_delete_of_a_deleting_table_returns_its_descriptionis renamedtest_delete_of_a_deleting_table_is_refused. It now asserts the 400 and that the table's catalog row is unchanged, and against Amazon DynamoDB it asserts the 400 on a real secondDeleteTable. It has noKeySchemaassertion, since the 200 answer it checked is gone.tests/test_table_operations.pygave 28 passed and 2 skipped on MongoDB.Merge notes
DeleteTable, with the sentence built asErrorMessageKey::TableBeingDeleted(this PR uses the same name and text), and changes the same lines ofcrates/engine/src/delete_table.rs, both backends'delete_table.rs,table_snapshot.rs,conftest.py,test_table_operations.pyanddocs/differences-from-dynamodb.md. Whichever of the two merges second drops its copy of the refusal. The member drop is only in this PR.crates/engine/src/delete_table.rs,docs/differences-from-dynamodb.mdandtests/test_table_operations.py.crates/engine/src/delete_table.rs.Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
ADR / RFC: n/a
Breaking changes: a second
DeleteTableof a DELETING table answers 400 on PostgreSQL and SQLite, and a DELETING description lacks seven members; see thev1.2.0upgrade-manual entry.By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.