Repository navigation
fix(core): refuse an empty index list in CreateTable - #1134
LeeroyHannigan wants to merge 1 commit into
Conversation
DynamoDB refuses a CreateTable whose GlobalSecondaryIndexes or LocalSecondaryIndexes member is an empty list. It answers ValidationException "One or more parameter values were invalid: List of <member> is empty" and creates no table. ExtendDB accepted the request, or refused it with the attribute definition count text when a definition was unused. CreateTable now refuses an empty list with the same text. With both lists empty, it names LocalSecondaryIndexes, as DynamoDB does. The refusal comes after the key schema check, the table throughput check and the check that each key attribute has a definition. It comes ahead of the check that each definition is used. An absent member still passes. The six requests of the issue were measured in us-east-1 on 2026-11-14. The order against a PROVISIONED table with no ProvisionedThroughput, two HASH keys and a key attribute with no definition was measured on 2026-11-18. Fixes #1023.
navareamol
left a comment
There was a problem hiding this comment.
-
validate_index_lists_not_emptycallsvalidate_provisioned_throughput, which refuses three things: PROVISIONED with no throughput (measured), PAY_PER_REQUEST withProvisionedThroughput, and capacity units below 1. WithGlobalSecondaryIndexes: []ExtendDB now answers "Neither ReadCapacityUnits nor WriteCapacityUnits can be specified when BillingMode is PAY_PER_REQUEST" and "ReadCapacityUnits and WriteCapacityUnits must both be greater than or equal to 1 for table" ahead of the empty-list text. Has anyone sent these two requests to DynamoDB? If DynamoDB answers the empty list first, the call could check only the missing throughput. Either way a row for each inan_empty_index_list_gets_the_answer_dynamodb_giveswould pin it. Today only the missing-throughput row holds the call in place: removing the call fails that row and nothing else. -
The empty-list refusal now comes ahead of every check after
validate_attribute_definitionsand ahead ofcheck_sse_specification. Two requests change answer against main on SQLite:- hash-only table, one LSI,
GlobalSecondaryIndexes: []: main gives the LSI range key refusal, this branch gives "List of GlobalSecondaryIndexes is empty". - six LSIs and
GlobalSecondaryIndexes: []: main gives the five LSI limit text, this branch gives the empty-list text.
Does DynamoDB answer the empty list ahead of these? The measured rows show only that it comes ahead of a definition no key uses. Could you measure these two and add them as rows?
- hash-only table, one LSI,
I will approve once the two throughput shapes and the two LSI shapes are measured and either pinned as rows or the check moved to match.
What
CreateTable now refuses an empty
GlobalSecondaryIndexesorLocalSecondaryIndexeslist withOne or more parameter values were invalid: List of <member> is empty, as DynamoDB does, and creates no table. With both lists empty, it namesLocalSecondaryIndexes. An absent member still passes. Before this change ExtendDB accepted such a request, or refused it with the attribute definition count text when no key used a definition.The refusal comes after the key schema check, the table throughput check and the check that each key attribute has a definition. It comes ahead of the check that a key uses each definition. DynamoDB answers them in this order.
ErrorMessageKey::IndexListEmptywrites the text.validate_index_lists_not_emptyruns insidevalidate_attribute_definitions, between its two definition loops. It callsvalidate_provisioned_throughputbefore it refuses, because origin/main runs the definition checks before the throughput check. Open PR #595 moves the throughput check above the definition checks. When #595 merges, that call can go.RestoreTableFromBackup turns an empty override list into an absent one before it runs the CreateTable checks, so a restore keeps its answer.
Why
These are DynamoDB's answers, measured in us-east-1. The issue's rows date from 14 November 2026. On 18 November 2026, more requests went to DynamoDB, and each one went out twice with the same answer both times. DynamoDB answers each of these faults ahead of an empty
GlobalSecondaryIndexesorLocalSecondaryIndexeslist:ProvisionedThroughput.KeySchemahas two HASH keys.SSESpecificationhasSSETypeAES256.TableClassis"BOGUS".Closes #1023
Testing done
The last change moved the check after the key attribute definition loop and added two rows for it. After it,
cargo test -p extenddb-core --libpassed 1147 with 1 ignored, and clippy on the core and fmt are clean. The other runs below are on the first form of the commit.cargo test -p extenddb-engine --lib: 870 passed.cargo +1.97.0 clippy -p extenddb-core -p extenddb-engine --all-targets -- -D warningsandcargo fmt --all -- --checkare clean.an_empty_index_list_gets_the_answer_dynamodb_givesholds the issue's rows and the order rows. An order row expects the answer of the same request without the empty list, so it holds whatever text ExtendDB gives the other fault. With the change reverted, the test fails.tests/test_table_operations.py,tests/test_multipart_gsi.py,tests/test_gsi_attribute_definitions.py,tests/python/test_gsi.pyand the override tests oftests/test_backup_restore_fidelity.pypassed 63 tests and skipped 1. The skipped test needs a table to stay DELETING, which SQLite never does. The restore withGlobalSecondaryIndexOverride=[]andLocalSecondaryIndexOverride=[]is among them.Line counts: production +38, tests +202.
Not in this PR, each in an open issue or PR:
SSESpecificationAES256and forTableClass"BOGUS", so it answers the empty list for them. Open PR fix(engine): refuse the TableClass and SSESpecification DynamoDB refuses #1114 adds both checks.Other open PRs:
TableClasscheck beforevalidate_create_table, so that order holds. It runs itsSSESpecificationcheck aftervalidate_create_table. When both PRs merge, an empty list beside anAES256SSESpecificationstill gets the empty-list text, where DynamoDB answers the SSE fault first. The second of the two to merge must move a check to keep DynamoDB's order.validate_index_lists_not_emptybecomes redundant.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.