Repository navigation
Conversation
CreateTable and UpdateTable refused a ReadCapacityUnits or WriteCapacityUnits below 1 with one sentence of ExtendDB's own. DynamoDB writes a constraint clause for each member below 1, with the member's request path and the value sent, WriteCapacityUnits first, counted in the lead sentence. A shared helper now builds that answer, and the table throughput of CreateTable, the global secondary index throughput of CreateTable, and the table throughput of UpdateTable use it. The index path names the index position, as the service does. The differences doc records the measured CreateTable form. RestoreTableFromBackup reaches the same table and index checks, so its override answers change with them; the exact restore paths stay #1097's. UpdateTable's GSI Create path was not measured and keeps its older text. Also gate the data_file_decode_peak test's line_len binding to Linux, where it is read, so clippy is clean off Linux. This is unrelated to the capacity fix. Refs #1147
LJMart11
left a comment
There was a problem hiding this comment.
Reviewed at 72ab651. 1 finding: 1 Important.
The change replaces the below-1 capacity message with per-member clauses for CreateTable table and GSI throughput and for UpdateTable table throughput. Confirmed against the live service and the SQLite backend: a single bad table member, both table members (writeCapacityUnits first), a table member of i64::MIN, and UpdateTable with 0/0, 0/5, 5/-1 and with BillingMode PROVISIONED or PAY_PER_REQUEST all return the same text on both. A single bad GSI also matches. cargo test -p extenddb-core -p extenddb-engine passed under 1.91.1.
- Important
crates/core/src/validation/mod.rs:260— CreateTable still stops at the first bad GSI and checks the table throughput first, so a request with several below-1 members gets fewer clauses and a smaller count than the service returns.
| for (i, gsi) in input.global_secondary_indexes.iter().flatten().enumerate() { | ||
| if let Some(t) = gsi.provisioned_throughput.as_ref() | ||
| && let Some(e) = validation_below_minimum_for_index(i + 1, t) | ||
| { |
There was a problem hiding this comment.
Important
The description says the message counts one clause per member below 1, but validate_gsi_throughput_minimum returns at the first bad GSI (validation/mod.rs:260-265), and validate_create_table returns the table's error at :120 before the GSI check at :122, so the clauses are never combined. The live service collects every below-1 member of the request into one message, GSIs in position order first, then the table. A client that parses the count or the paths sees a different message from the service, and nothing in logs or metrics shows the difference.
Fix: gather the clauses from every GSI (positions 1..n) and then from the table in validate_create_table, and build one N validation error(s) detected: ... message from them; the tests at validation/mod.rs:3365-3457 and backup/tests.rs:5451-5461 cover single-surface cases only and need an added multi-surface case. Alternatively state in the PR body and docs/differences-from-dynamodb.md:113 that multiple surfaces are reported one at a time. No migration.
Evidence: sent the same CreateTable to the live service and to the SQLite harness server (client validation off). Table 1/1, GSI1 0/0, GSI2 0/7: service 3 validation errors detected: with GSI1 write, GSI1 read and globalSecondaryIndexes.2.member.provisionedThroughput.readCapacityUnits; head 2 validation errors detected: with GSI1 only. Table 0/1, GSI1 1/1, GSI2 0/7: service 2 validation errors detected: (globalSecondaryIndexes.2...readCapacityUnits then provisionedThroughput.readCapacityUnits); head 1 validation error detected: with the table clause only. Table 0/0 plus GSI1 0/0: service 4 errors (GSI clauses, then table); head 2 (table only).
There was a problem hiding this comment.
Fixed in 52cf343 and b7aa533. CreateTable now names the capacity figures below 1 of every GSI and of the table in one message, the GSIs in position order first, and at most 10, as the service does. Your three requests and the ones measured on 2 December give the service's text, and a unit test pins each of them as a literal.
When the table has no ProvisionedThroughput, or the key schema or attribute definitions have a fault too, ExtendDB still answers that check first, where the service names the throughput members. The PR body lists this.
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Thanks. I read the change against main 92155f3. The CreateTable and UpdateTable table texts and the write-first order match #1147's rows and my comment of 21 November there. The check stays where it was, ahead of any storage read. On this branch the core validation tests (228), the engine update_table tests (11) and the engine backup tests (467) passed. Against servers built from this branch and from main, tests/test_table_operations.py passed 26 here, with 1 skip. On main only test_update_table_zero_throughput failed, at the text this PR sets. CI passed, and the branch merges with main.
LJMart11's comment on line 260 still stands. I measured it again in us-east-1 on 2 December, each request twice:
| CreateTable throughput | DynamoDB |
|---|---|
| table {0, 5}, gsi1 {5, 0} | "2 validation errors detected: Value '0' at 'globalSecondaryIndexes.1.member.provisionedThroughput.writeCapacityUnits' failed to satisfy constraint: ...; Value '0' at 'provisionedThroughput.readCapacityUnits' failed to satisfy constraint: ..." |
| table {1, 1}, gsi1 {0, 5}, gsi2 {5, 0} | "2 validation errors detected: Value '0' at 'globalSecondaryIndexes.1.member.provisionedThroughput.readCapacityUnits' failed to satisfy constraint: ...; Value '0' at 'globalSecondaryIndexes.2.member.provisionedThroughput.writeCapacityUnits' failed to satisfy constraint: ..." |
This PR answers one clause for each request.
This overlaps #1096 (opened 17 November), which builds the same clause for the restore override with extenddb_core::error::validation_errors, the helper that #1147 names. Under code-size.md, the second of the two PRs to merge drops its copy. The two conflict in one hunk of crates/engine/src/backup/tests.rs, and so do #1353, #1365 and #1373, which build on #1096.
This needs three changes before it merges:
provisioned_below_minimum_errorbuilds by hand the envelope and the clause thatvalidation_errorsincrates/core/src/error/messages.rsalready builds. If the table and every GSI add their clauses to one call of it, the count is also the service's.- The restore override tests now pin texts that the service does not send. The inline comments on
backup/tests.rshave the measured paths. - 1.1.0 answered other texts for capacity below 1 on CreateTable, on its GSIs and on UpdateTable.
docs/versioning.mdputs such changes under Behavior Changes by Release in the upgrade manual, so this needs av1.2.0:entry.
On the description: it says "Refs #1147", so a merge leaves #1147 open, although the PR covers all four of its rows. The inline comments are smaller.
| (read, "readCapacityUnits") | ||
| }; | ||
| let expected = format!( | ||
| "1 validation error detected: Value '{value}' at 'provisionedThroughput.{unit}' \ |
There was a problem hiding this comment.
The service names this member provisionedThroughputOverride.{unit} (#1096's measured rows of 13 and 14 November), so this test now pins a text that DynamoDB does not send. provisioned_below_minimum_error already takes a prefix, so validate_override_shape can pass provisionedThroughputOverride. Or this test can stay as main has it, and #1096 sets the restore text.
There was a problem hiding this comment.
| "{0, 0}", | ||
| json!({ "GlobalSecondaryIndexOverride": [gsi_entry(Some((0, 0)))] }), | ||
| "ReadCapacityUnits and WriteCapacityUnits must both be greater than or equal to 1", | ||
| "2 validation errors detected: Value '0' at 'globalSecondaryIndexes.1.member.provisionedThroughput.writeCapacityUnits' failed to satisfy constraint: Member must have value greater than or equal to 1; Value '0' at 'globalSecondaryIndexes.1.member.provisionedThroughput.readCapacityUnits' failed to satisfy constraint: Member must have value greater than or equal to 1", |
There was a problem hiding this comment.
For a GSI override below 1, DynamoDB answers 2 validation errors detected: Value '0' at 'globalSecondaryIndexOverride.1.member.provisionedThroughput.writeCapacityUnits' ...; Value '0' at 'globalSecondaryIndexOverride.1.member.provisionedThroughput.readCapacityUnits' ..., before it reads the backup. I measured it on 2 December with a backup ARN that does not exist, each request twice. This line pins globalSecondaryIndexes.1.member....
There was a problem hiding this comment.
This row now pins only the constraint. ExtendDB checks the index throughput on the restored definition, after it reads the backup, so it cannot name globalSecondaryIndexOverride.<n>.member yet. #1097 tracks that, and the test comment names it.
| /// `"globalSecondaryIndexes.<n>.member.provisionedThroughput"`. The service | ||
| /// writes one constraint clause per member below 1, `writeCapacityUnits` | ||
| /// first, and counts them in the lead sentence. | ||
| pub fn provisioned_below_minimum_error( |
There was a problem hiding this comment.
See the review body: extenddb_core::error::validation_errors builds this envelope and clause. With one list of faults for the table and every GSI, this function becomes a short wrapper, and #1096 can call it with provisionedThroughputOverride.
| encoder.write_all(&line).unwrap(); | ||
| encoder.finish().unwrap() | ||
| }; | ||
| #[cfg(target_os = "linux")] |
CreateTable stopped at the table's throughput, or at the first global secondary index with a figure below 1, so a request with several such members got fewer clauses and a smaller count than DynamoDB returns. The service names every member below 1 of every index and of the table in one message, the indexes in position order first (us-east-1, 2026-12-02, each request sent twice). The clauses now go to one call of validation_errors. RestoreTableFromBackup names a ProvisionedThroughputOverride member as provisionedThroughputOverride.<member>, as the service does. The test of a GlobalSecondaryIndexOverride below 1 pins only the constraint: the service names globalSecondaryIndexOverride.<n>.member, which ExtendDB does not yet do. The upgrade manual lists the new texts under v1.2.0. The macOS gate in data_file_decode_peak.rs goes back to main's form. Refs #1147 Signed-off-by: Elise Ong <eliseong@amazon.com>
…ow-1-message-2026-11-24
With more than 10 capacity figures below 1, DynamoDB names and counts the first 10 (us-east-1, 2026-12-02, 20 and 21 indexes). The message now does the same. The tests pin the measured texts as literals, with a request id for each, and pin the four rows of #1147 on the CreateTable path. The upgrade manual entry and the differences row name the surfaces this changes and the ones it does not: UpdateTable's GSI Create keeps its text, and a GlobalSecondaryIndexOverride on a restore whose table is PROVISIONED gets the CreateTable text. Signed-off-by: Elise Ong <eliseong@amazon.com>
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve. The three round 1 conditions are met.
- One
validation_errorscall now names every capacity figure below 1. On CreateTable it lists the GSIs in position order, then the table. - The restore override names
provisionedThroughputOverride.<member>. - There is a
v1.2.0:upgrade entry.
The push also adds a cap: the message names and counts the first 10 figures. I measured that on DynamoDB in us-east-1, six requests, each sent twice. With 10 to 42 figures below 1, the service never named more than 10. It chose the GSIs in position order, write before read, then the table. The new unit tests pin these measured strings as literals. I changed the fix in two ways to check the tests catch a regression. With the cap removed, at_most_ten_throughput_faults_are_named fails. With the table placed before the GSIs, every_throughput_below_one_is_named_in_one_message fails.
I built the branch at b7aa533 and ran the tests that cover the change. Core validation passed 230, engine UpdateTable 11, engine backup 467. fmt and clippy are clean.
Duplication and size. The restore override change duplicates #1096 (opened 17 November). #1096 rewrites the same validate_override_shape and builds the same provisionedThroughputOverride clause from validation_errors, with the same member order and text. #1096 came first and is the dedicated restore PR. Whichever of the two merges second drops its copy. The 10-figure cap repeats the MAX_PARTS limit in crates/engine/src/partiql/request_checks.rs, which caps the same kind of message at 10. One shared constant, with a comment on the measurement, would keep the two limits the same. Size is production +114 and -38, tests +306 and -11, docs +27 and -1.
The points below are not conditions for approval:
- The description is out of date. It says the PR gates the
data_file_decode_peaktest, which the branch reverted. It says "Refs #1147" though it covers all four of that issue's rows. It says the restore paths are out of scope, but the table override now carries the service path. - The measured rows sit in two test functions that repeat their setup. One parametrized test over all the rows would remove the copy.
|
The three changes are in 52cf343 and b7aa533. CreateTable names the figures below 1 of the table and every GSI with one call of |
…ow-1-message-2026-11-24
|
@LeeroyHannigan The branch conflicted with main after #1403 added its own v1.2.0 entry to the upgrade manual. 04ea133 merges main and keeps both entries, #1403's first. No code changed since b7aa533, which you approved. |
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve again. 04ea133 only merges main at e8b5f10. Your own change is the same in all seven files against the new main, the upgrade entry included, so I checked only that merge.
CI passed at this head, 75 of 75, and the branch merges cleanly with main at c8e66fb. Main changed four of the same files after e8b5f10, and your change still applies to each of them unchanged.
The restore override change still duplicates #1096, which came first. Whichever of the two merges second drops its copy.
navareamol
left a comment
There was a problem hiding this comment.
I ran this head on SQLite next to a build of main, with a test of my own that sends the below 1 capacity requests that the description lists and some more. On main every CreateTable, UpdateTable and restore override case gives the old single sentence. On this head each one names the member, the value and the request path. A table 0/5 with a GSI 5/0 names the GSI first and the table second. Eleven GSIs at 0/0 give "10 validation errors". A GSI with no throughput on a provisioned table is still accepted, as on main. The UpdateTable index Create keeps the old text, as the description says. On a real backup, a GlobalSecondaryIndexOverride at 0/0 now names globalSecondaryIndexes.1.member.provisionedThroughput, and main said "for index: gsi1". The wire test test_update_table_zero_throughput passes here and fails on main. I did not check any answer against the live service, so the expected strings rest on the measurements already in this thread.
Two small things in the description and the branch. The test counts say 1247 for core and 978 for engine. At this head I get 1264 passed for core and 980 for engine, because main was merged into the branch after those numbers were taken. Could you update them? The branch also conflicts with main in docs/manuals/07-upgrade-manual.md. With the PR side kept in that file, the merged tree passes the core and engine lib tests here (1265 and 985).
I will approve once the branch is merged with main and the test counts in the description match.
…ow-1-message-2026-11-24 # Conflicts: # docs/manuals/07-upgrade-manual.md
LeeroyHannigan
left a comment
There was a problem hiding this comment.
Approve again. 2c80beb only merges main at 1e2ebdd. Your own change is the same in all seven files against the new main, the upgrade entry included, so I checked only that merge.
CI passed at this head, 75 checks. One run of the PR title check was cancelled when a second run started, and the second run passed. The branch merges cleanly with main at 1e2ebdd.
The restore override change still duplicates #1096, which came first. Whichever of the two merges second drops its copy.
What
On a
PROVISIONEDtable, aReadCapacityUnitsorWriteCapacityUnitsbelow 1 is now refused with the service's text: one constraint clause for each member below 1, naming the member's request path and the value sent,writeCapacityUnitsbeforereadCapacityUnits, counted in the lead sentence (N validation error(s) detected: ...).CreateTablewith a tableProvisionedThroughputnames the members of every global secondary index and of the table in one message, the indexes in position order first, asglobalSecondaryIndexes.<n>.member.provisionedThroughput.<member>andprovisionedThroughput.<member>. It names and counts at most 10, as the service does.UpdateTablenames the table's members.RestoreTableFromBackupnames aProvisionedThroughputOverridemember asprovisionedThroughputOverride.<member>.The clauses go to one call of
extenddb_core::error::validation_errors.UpdateTable's indexCreatekeeps its existing text. The upgrade manual lists the change under v1.2.0.Why
ExtendDB answered these requests with one sentence of its own. The service names each member and the value.
Closes #1147
Testing done
ProvisionedThroughputOverride{0, 5}, {5, 0} and {0, 0}, on aBackupArnthat does not exist.tests/test_table_operations.py::test_update_table_zero_throughputasserts the UpdateTable text end to end; it fails on main.cargo test -p extenddb-core --lib(1265 passed) andcargo test -p extenddb-engine --lib(985 passed).cargo fmt --all -- --checkis clean.cargo clippy -p extenddb-core -p extenddb-engine --all-targets -- -D warningsis clean apart from the unusedline_lenincrates/core/tests/data_file_decode_peak.rson macOS, which main has too.Notes
provisionedThroughputOverridetexts for the restore override. The two conflict invalidate_override_shapeincrates/engine/src/backup.rsand in one block ofcrates/engine/src/backup/tests.rs, and the second to merge drops its copy. If this PR merges first, fix(engine): give RestoreTableFromBackup override conflicts DynamoDB's texts #1096 replaces its block invalidate_override_shapewith a call ofprovisioned_below_minimum_error(read, write, "provisionedThroughputOverride"). If fix(engine): give RestoreTableFromBackup override conflicts DynamoDB's texts #1096 merges first, this PR takes fix(engine): give RestoreTableFromBackup override conflicts DynamoDB's texts #1096's side of both hunks. Both give the same texts. fix(engine): check a restore's override values in DynamoDB's order #1353, fix(engine): answer missing restore override members as DynamoDB does #1365 and fix(engine): answer a ListBackups cursor with DynamoDB's texts #1373 build on fix(engine): give RestoreTableFromBackup override conflicts DynamoDB's texts #1096 and resolve the same way.ProvisionedThroughput, and on aPAY_PER_REQUESTtable too. ExtendDB answers those checks first.UpdateTable's indexCreatekeeps its text, where the service namesglobalSecondaryIndexUpdates.<n>.member.create.provisionedThroughput.<member>.GlobalSecondaryIndexOverridebelow 1 asglobalSecondaryIndexOverride.<n>.member...before it reads the backup, and names it beside aProvisionedThroughputOverridebelow 1 in one message (RestoreTableFromBackup: five more override refusals differ from DynamoDB, for a missing backup, a changed or repeated index, and index throughputs below 1 #1097).line_lengate incrates/core/tests/data_file_decode_peak.rsis no longer part of this PR.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
None. The error type and the HTTP status do not change. The new texts are listed in the upgrade manual under v1.2.0.
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.