Repository navigation
fix(engine): name a missing table in the table operations' error text - #1117
LeeroyHannigan wants to merge 1 commit into
Conversation
DescribeTable, DeleteTable, UpdateTable, DescribeTimeToLive and UpdateTimeToLive answered ResourceNotFoundException with "Requested resource not found" for a table that does not exist. DynamoDB answers these operations with "Requested resource not found: Table: <name> not found". It gives the same text with the table's name when TableName is the table's ARN. It answers the item operations with "Requested resource not found" alone. The answers were measured in us-east-1 on 2026-11-13, 2026-11-14 and 2026-11-18. ErrorMessageKey::TableNotFound now writes the text with the name it receives. The new storage_err_to_dynamo_naming_table maps a missing table to that text, and reduces a table ARN to its table name first. DescribeTable and DeleteTable map their storage errors with it. update_table_err_to_dynamo and storage_to_dynamo in ttl.rs pass a missing table to it. storage_err_to_dynamo keeps the text without the name for the item operations and its other callers. The wire test sends each measured request for a missing table. The engine test sends DescribeTable and GetItem, and checks that GetItem keeps the text without the name. Fixes #1055.
navareamol
left a comment
There was a problem hiding this comment.
This branch conflicts with main. GitHub shows it as DIRTY, and git merge-tree reports a content conflict in crates/engine/src/partiql/test_context.rs. #1449 (2a820be) rewrote context on main to build on crate::test_context::context_on, and this PR changes the visibility of the old body. The branch is 53 commits behind main, so the green CI is on an older tree. I resolved it locally by keeping main's body with pub(crate), and on SQLite the merged tree passes the core and engine lib tests, clippy and test_table_operations.py. Could you merge main? I think the engine test could also build its context with main's crate::test_context::context_on(Arc::new(SqliteEngine::new(path, ...)), "000000000000"), which would drop the two partiql visibility changes and the overlap with #1114, #1110, #1100 and #633. The description says those lines merge without a conflict, which is no longer true against main.
The description says #963 adds calls to update_table_err_to_dynamo. #963 has merged (cd89008). On the merged tree its paths name the table too, so I think the description only needs to say it is merged.
I will approve once the branch is updated with main and CI is green on the merged tree.
What
DescribeTable, DeleteTable, UpdateTable, DescribeTimeToLive and UpdateTimeToLive now answer a missing table with DynamoDB's text,
Requested resource not found: Table: <name> not found. They answeredRequested resource not found, which is the text DynamoDB gives the item operations. When UpdateTable gets the table's ARN asTableName, the text names the table, as on DynamoDB. The item operations keep the text without the name.ErrorMessageKey::TableNotFoundnow writes the name it receives (crates/core/src/error/messages.rs). The newstorage_err_to_dynamo_naming_table(crates/engine/src/create_table.rs) maps a missing table to that text, and it reduces a table ARN to its table name first. DescribeTable and DeleteTable map their storage errors with it.update_table_err_to_dynamoandstorage_to_dynamoincrates/engine/src/ttl.rspass a missing table to it.storage_err_to_dynamowrites the text without the name for its other callers.partiql::test_context::contextand its module becomepub(crate), so that the engine test can use the SQLite context of the PartiQL tests.Why
These are DynamoDB's answers, measured in us-east-1. The rows of the issue were measured on 13 and 14 November 2026. On 18 November 2026, 22 requests for a missing table went out twice each, to DynamoDB and to ExtendDB on SQLite. The two ExtendDB builds came from origin/main and from this commit. Each request got the same answer both times.
DynamoDB names the table in 16 of the 22 answers. This commit gives 12 of them word for word, and origin/main gives none. The other 4 send the table's ARN to DescribeTable, DeleteTable, DescribeTimeToLive or UpdateTimeToLive (listed below). GetItem keeps
Requested resource not foundon both trees, as on DynamoDB.Closes #1055
Testing done
cargo test -p extenddb-core --lib: 1146 passed, 1 ignored.cargo test -p extenddb-engine --lib: 871 passed.cargo +1.97.0 clippy --all-targets -- -D warningsonextenddb-coreandextenddb-engine, andcargo fmt --check, are clean.a_missing_table_is_named_by_the_table_operationssends DescribeTable and GetItem for a missing table to an empty SQLite catalog. Without the fix, its DescribeTable row fails.tests/test_table_operations.py::TestMissingTablesends the rows of the issue, UpdateTimeToLive, and UpdateTable with the table's ARN. Its 7 tests pass on this commit and fail on origin/main.Requested resource not foundorResourceNotFoundExceptionpassed 2,825 tests in four runs against ExtendDB on SQLite. The failures in those runs come from the test setup. They involve the admin login, import paths, the backup store, the metrics endpoint, throttling and the console certificate. None of them is in a file that holdsRequested resource not found.Line counts: production +33 -12, tests +96 -3.
Not in this PR, each with origin/main's answer:
TableNamewith thetableNamepatternValidationException. DynamoDB looks the table up. A comment on A table ARN passed as TableName returns ResourceNotFoundException #442 gives the rows.ResourceNotFoundException. DynamoDB answers1 validation error detected: Invalid AWS region in '<arn>'(A table ARN in TableName with another partition, service or region is not refused as the service refuses it #794).ProvisionedThroughputanswersResourceNotFoundException. DynamoDB answersOne or more parameter values were invalid: You cannot modify stream status while updating table IOPS(UpdateTable of a missing table with a stream change beside ProvisionedThroughput answers ResourceNotFoundException, where DynamoDB refuses the pair #1115).AccessDeniedExceptionwith another__typenamespace and message key than DynamoDB's (UpdateTable with a table ARN of an account that does not exist answers AccessDeniedException with another __type and message key than DynamoDB #1116).Other open PRs:
crates/engine/src/delete_table.rsthat callsstorage_err_to_dynamothroughuse super::*;. This PR removes that import, becausedelete_table.rsno longer calls the function. The files merge without a conflict, butcargo check -p extenddb-engine --testsof each merge fails withE0425. The PR that merges second addsuse crate::create_table::storage_err_to_dynamo;to that test module.pub(crate)change topartiql/mod.rsandpartiql/test_context.rs. The lines merge without a conflict.update_table_err_to_dynamo, so their paths also answer a missing table with its name.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
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.