Skip to content

fix(engine): name a missing table in the table operations' error text - #1117

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1055-table-not-found-name
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/1055-table-not-found-name

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

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 answered Requested resource not found, which is the text DynamoDB gives the item operations. When UpdateTable gets the table's ARN as TableName, the text names the table, as on DynamoDB. The item operations keep the text without the name.

ErrorMessageKey::TableNotFound now writes the name it receives (crates/core/src/error/messages.rs). The new storage_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_dynamo and storage_to_dynamo in crates/engine/src/ttl.rs pass a missing table to it. storage_err_to_dynamo writes the text without the name for its other callers.

partiql::test_context::context and its module become pub(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 found on 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 warnings on extenddb-core and extenddb-engine, and cargo fmt --check, are clean.
  • The engine test a_missing_table_is_named_by_the_table_operations sends DescribeTable and GetItem for a missing table to an empty SQLite catalog. Without the fix, its DescribeTable row fails.
  • tests/test_table_operations.py::TestMissingTable sends 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.
  • The wire files that hold Requested resource not found or ResourceNotFoundException passed 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 holds Requested resource not found.

Line counts: production +33 -12, tests +96 -3.

Not in this PR, each with origin/main's answer:

Other open PRs:

Checklist

  • I have read CONTRIBUTING.md
  • All tests pass (cargo test --workspace)
  • Code is formatted (cargo fmt --check)
  • Clippy is clean (cargo clippy -- -W clippy::pedantic)
  • I have added or updated tests for new functionality
  • I have updated documentation if behavior changed
  • Breaking changes are noted below (if any)
  • If this changes the wire protocol, Storage trait, auth model, on-disk
    format, 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.

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 navareamol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DescribeTable, DeleteTable, UpdateTable and DescribeTimeToLive of a missing table leave the table name out of the ResourceNotFoundException text

2 participants