Skip to content

fix: enforce the table quota, the provisioned-capacity maxima and max_policy_document_bytes - #831

Open
LeeroyHannigan wants to merge 33 commits into
mainfrom
fix/538-enforce-limits-keys
Open

LeeroyHannigan wants to merge 33 commits into
mainfrom
fix/538-enforce-limits-keys

Conversation

@LeeroyHannigan

@LeeroyHannigan LeeroyHannigan commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Changes since the last review

The branch is at 0d53c9e. LJMart11 reviewed bd27313 on 3 Dec 2026, and one commit comes after that review:

These commits sit on b2b4dc7, the head that the reviews of 27 Nov 2026 read, and end at bd27313:

  • 3c583fb merges main at c057660. Four files conflicted. crates/engine/src/partiql/test_context.rs builds its context on main's crate::test_context::context_on. crates/engine/src/update_table.rs reads the table for main's companion.is_some() and for this branch's raises_capacity. crates/server/src/authz_cache.rs keys the session loader by access key, as main does, and keeps the size limit. docs/manuals/07-upgrade-manual.md keeps main's ClientRequestToken entry where main moved it.
  • 7159789 builds the account limits test on crate::test_context, so the PartiQL test helper keeps main's pub(super).
  • eae9d05 checks the table and each global secondary index of a CreateTable against the per-table maximum on their own, with the per-index sentence for an index. Before, the per-table maximum held the table and its indexes together.
  • b0c532c makes UpdateTable answer a table that is not ACTIVE, and an index Create that names an index the table holds, before the maxima.
  • 221da50 answers a name that the account's list holds with ResourceInUseException from the limits read. Before, the read returned Ok(()) and left the name to the backend.
  • 5f28cba checks the table quota and the capacity maxima on ImportTable.
  • 4c72985 adds a test that reads a second page of the account's tables.
  • 005f7d3 and 6a8fd3d add tests of max_policy_document_bytes on each path that writes or loads a policy.
  • b1deb7b moves the upgrade manual entry to v1.2.0, because v1.1.0 shipped without this change.
  • 653bf21 formats three test files with cargo fmt.
  • bd27313 inlines a helper that had one caller and shares one index of the engine test.

The body names ImportTable and the per-index check, gives the counts of 0d53c9e, and lists the conflicts with open PRs at 0d53c9e.

What

Six [limits] keys that the server accepted and did not act on now take effect.

  • max_tables_per_account: CreateTable and ImportTable count the account's tables. When the account already holds the quota, they refuse the new table with LimitExceededException: There is a soft account quota of {n} tables.
  • per_table_max_rcu, per_table_max_wcu, per_account_max_rcu and per_account_max_wcu: CreateTable, ImportTable and UpdateTable refuse a provisioned throughput over a maximum with LimitExceededException. The checks are in crates/core/src/validation/provisioned_limits.rs. crates/engine/src/table_limits.rs reads what the account holds.
    • CreateTable and ImportTable check the account maximum first, against the table and its indexes together. Then they check the table's own throughput against the per-table maximum. Then they check each index's throughput against the same maximum, with the per-index sentence: The requested <unit> for index <name>, <n>, is above the per index maximum for the account in <region>. Per table maximum: <max>. and the limits guide sentence.
    • UpdateTable first gives two answers of earlier releases: ResourceInUseException for a table that is not ACTIVE, and ValidationException for an index Create that names an index the table holds. Then it checks the table's own ProvisionedThroughput against the per-table maximum. Then it checks the account maximum against what the table and its indexes hold after the change.
    • A unit that the request does not raise is not refused. So a table above a lowered maximum can still be lowered. An on-demand table holds no units, so each figure of a switch back to PROVISIONED is a raise.
    • Read units come before write units, as measured.
  • max_policy_document_bytes: the policy size limit was the literal 6,144 in PolicyDocument::from_json. The management API's policy and permissions boundary handlers and the console's policy page now pass the key to from_json_for_write. AssumeRole checks a session policy against the key, where it used 6,144 before. The authorization cache parses a stored identity policy, permissions boundary or session policy with the same key. The security model manual names the key.

RestoreTableFromBackup does not check the table quota or the capacity maxima. docs/dynamodb-limits.md marks these five limits as Partial. #1481 tracks RestoreTableFromBackup, and this PR fixes its ImportTable half.

On CreateTable the order is the measured one: the definition checks, then a taken name (ResourceInUseException), then the capacity limits. The table quota comes last. Its position was not measured.

Two checks of the backend have a second copy here, for the order:

  • The limits read answers a taken name with the backend's ResourceInUseException, Table already exists: <name>. The backend checks the name again when it creates the table. Before 221da50, a DeleteTable of that name between the read and the create let an unchecked create through (review of 27 Nov 2026).
  • UpdateTable answers a table that is not ACTIVE and a taken index name with the backend's texts, before the maxima. The backend checks both again when it applies the change.

Other effects:

Why

The issue lists the keys and the code that ignored them. The comment on the issue has the answers of Amazon DynamoDB, measured on 2026-10-31. This change uses those sentences where a measurement exists.

The review of 27 Nov 2026 measured these answers on tables that it created, and this round did not send them again:

  • CreateTable over the per-table maximum while the account stays under its maximum: the per-table sentence.
  • CreateTable of a table at 20001 read units with an index at 20000, under a per-table maximum of 40000: created. An index at 40001: the per-index sentence.
  • UpdateTable over a maximum on a table that is CREATING, DELETING or UPDATING: ResourceInUseException.
  • UpdateTable that raises the table's own throughput over the account maximum, an index Create over it, and a switch back to PROVISIONED: the sentences of this change.

On 3 Dec 2026, UpdateTable on a table that does not exist answered ResourceNotFoundException before either maximum. The requests set read units one over the maximum, or sent an index Create. Each request went out twice.

These answers are not in the measurements:

  • The table quota sentence. It is the wording of the LimitExceededException API reference.
  • The position of the table quota check among the CreateTable checks.

Closes #538

Conflicts with open PRs

On 4 December 2026, git merge-tree compared 0d53c9e and main with each of the 221 open PRs. It finds these conflicts with this PR, and main has none of them:

In docs/manuals/07-upgrade-manual.md, the v1.2.0 entry of this PR sits after main's v1.2.0 entries, above the v1.1.0 entries. 30 open PRs conflict with this PR in that file, and each of them conflicts with main there too. Open PRs that add their entries at the same place conflict there. Keep both entries.

Testing done

At 0d53c9e, the merge of main, with toolchain 1.97.0:

  • cargo fmt --all -- --check: clean.
  • The two clippy commands of .github/workflows/clippy.yml with -D warnings, on the whole workspace as CI runs them: clean.
  • cargo clippy --all-targets -- -W clippy::pedantic on extenddb-core, extenddb-auth, extenddb-engine and extenddb-server: no warning on a line that this change adds.
  • cargo test --lib: extenddb-core 1270 passed and 1 ignored, extenddb-auth 540 passed, extenddb-engine 985 passed. extenddb-server has 528 tests, and 523 passed. The five backup_store tests fail on this host only, as the block of bd27313 says.
  • cargo test -p extenddb-wasm-adapter: 3 passed, and the parity corpus test passed. cargo test -p extenddb-storage-postgres --test doc_version_literals: 3 passed.
  • tests/test_policy_size_limit_sqlite.py, with the SQLite build of 0d53c9e, on a SQLite deployment of its own on 127.0.0.1: 1 passed.
  • python3 -m pytest --collect-only -q of tests/ (7342 tests) and of tests/python (820): no error.

At bd27313, with toolchain 1.97.0 unless a line names another:

  • cargo fmt --all -- --check: clean.
  • The two clippy commands of .github/workflows/clippy.yml with -D warnings: clean. The first ran on extenddb-core, extenddb-auth, extenddb-engine and extenddb-server, and the second on extenddb-engine, whose feature it turns on.
  • cargo clippy --all-targets -- -W clippy::pedantic on the same four crates: no warning on a line that this change adds.
  • cargo +1.94.0 check --all-targets on the four crates: clean.
  • The clippy step of .github/workflows/wasm.yml for wasm32-unknown-unknown: clean. This host has no clang, so the run used a stand-in C compiler and archiver. Clippy does not link.
  • cargo test -p extenddb-wasm-adapter: 3 passed, and the parity corpus test passed.
  • cargo test --lib: extenddb-core 1270 passed and 1 ignored, extenddb-auth 540 passed, extenddb-engine 985 passed. extenddb-server has 528 tests, and 523 passed. Five backup_store tests fail on this host only, because /local/home belongs to uid 65534 and the spool checks refuse a directory under it. storage-sqlite: the two write_lock_tests fail when an ancestor of the Cargo target directory is owned by another user #1414 describes the same cause for two extenddb-storage-sqlite tests. This PR does not change that file.
  • cargo test --release --no-fail-fast -p extenddb-storage-postgres --tests, as the PostgreSQL storage job of CI runs it, against pgvector/pgvector:pg16 on 127.0.0.1: 500 passed, 2 ignored and 5 failed, in 46 test binaries. The failures are three store_identity tests of backup_restore.rs and two tests of catalog_nul_backup_jobs.rs. Each gets PermissionDenied for its backup root, because /local/home on this host belongs to uid 65534. doc_version_literals passed 3 of 3.
  • python3 -m pytest --collect-only -q of tests/ (7305 tests) and of tests/python (820): no error.
  • Against SQLite and PostgreSQL builds of bd27313 on 127.0.0.1, with the four settings that devtools/run-tests makes:
    • tests/test_misc_operations.py, tests/test_table_operations.py, tests/test_table_throughput_mode.py and tests/test_update_table_billing_validation.py: 60 passed on each.
    • tests/test_import_export.py and tests/test_backup_restore_fidelity.py, with [import] and [export] paths and EXTENDDB_TEST_BACKUP_STORE=none as devtools/run-tests sets them: 72 passed on each.
    • tests/python/test_control_plane.py: 15 passed on each.
    • tests/test_policy_size_limit_sqlite.py, on a SQLite deployment of its own: 1 passed.
  • The tests of this change, each with the control that it fails on:
    • provisioned_limits_tests.rs has 10 tests. They compare the full sentences, and check each maximum at its value and one unit above.
    • create_table_holds_the_table_and_each_index_to_the_default_maxima in provisioned_limits_tests.rs holds the rows of the review of 27 Nov 2026 at the default maxima. It fails with the check of the sum put back.
    • table_limits_tests.rs sends CreateTable, ImportTable and UpdateTable rows through the handlers, on an in-memory SQLite catalog. Its tests fail on each of these controls:
      • the check of the sum put back
      • handle_update_table without its call of refuse_ahead_of_the_maxima
      • Ok(()) for a taken name
      • import_table without its call of enforce_create_table
      • the read of the account's tables stopped after its first page
    • At b2b4dc7 table_limits_tests.rs also failed without the call of enforce_create_table or of enforce_update_table, and with the CreateTable limits ahead of the definition checks.
    • a_table_that_is_not_active_and_a_taken_index_name_come_ahead_of_the_maxima in update_table_tests.rs fails with the status check taken out.
    • the_size_limit_is_the_one_the_caller_passes in extenddb-auth checks both parse paths at the limit and one byte over it.
    • a_stored_policy_over_the_configured_size_does_not_load in authz_cache.rs fails with the default size passed to any of the six loaders that parse a stored policy.
    • tests/test_policy_size_limit_sqlite.py fails with the default size put back at any of the six other sites: serve.rs, lib.rs, iam_policy.rs, permissions_boundary.rs, policy_pages.rs and assume_role.rs.
  • At b2b4dc7, a manual run against a SQLite build on 127.0.0.1 got the expected answers. It covered the table quota, both maxima on CreateTable and UpdateTable, and max_policy_document_bytes before and after a restart. table_limits_tests.rs and tests/test_policy_size_limit_sqlite.py now hold those rows.

Line counts against main, at 0d53c9e: production +784 -109, tests +1218 -12, docs +34 -7. The commits from b2b4dc7 to bd27313: production +113 -34, tests +620 -115, docs +32 -33.

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

Breaking changes

The server now refuses requests that it accepted before. With the defaults, it refuses a table or an index over 40,000 RCU or WCU and an account over 80,000 RCU or WCU, on CreateTable, ImportTable and UpdateTable. It also refuses a 2,501st table. A deployment that relies on more must raise the keys. The v1.2.0 entry of the upgrade manual lists the keys.

A deployment that set max_policy_document_bytes below 6,144 now refuses a new policy above the key. It also denies the requests of a principal whose stored policy is above the key.

PolicyDocument::from_json_for_write and PolicyDocument::from_json_for_session_policy now take the size limit as a second argument. ConsoleState, ManagementState and AuthzCacheConfig of extenddb-server have a new field, max_policy_document_bytes.


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.

Pure checks for max_tables_per_account, per_table_max_rcu/wcu and
per_account_max_rcu/wcu, with the LimitExceededException sentences the
service returns for a provisioned value over a maximum.
CreateTable counts the account's tables and refuses one over
max_tables_per_account, and CreateTable and UpdateTable refuse a
provisioned throughput over the per-table or account maximum with
LimitExceededException. A name the account already holds is still
refused as taken first.
The size limit of a policy document was the literal 6,144 in
PolicyDocument::from_json, so the max_policy_document_bytes key changed
nothing. The key is now the limit on both paths.

- Write: from_json_for_write now takes the limit as an argument. The
  management API's policy and permissions boundary handlers and the
  console's policy page pass the key to it.
- Read: the authorization cache parses a stored identity policy,
  permissions boundary or session policy with the key. A stored policy
  over it does not parse, and authorization answers AccessDenied.

from_json keeps the default of 6,144 bytes, now the named constant
DEFAULT_MAX_POLICY_DOCUMENT_BYTES. The security model manual names the
key.
from_json_for_write now takes the limit as a second argument, and the
fuzz target called it with one. The target now drives
from_json_with_size_limit and from_json_for_write with
DEFAULT_MAX_POLICY_DOCUMENT_BYTES, the two calls the server makes, and
its header names them.
crates/auth/src/policy/document.rs keeps the reference and Arn value checks of from_json_for_write from main and its size limit argument from this branch.
In that file, the reference check now gets the same limit.
DEFAULT_MAX_POLICY_DOCUMENT_BYTES from this branch replaces the MAX_POLICY_BYTES constant from main, which holds the same 6,144 bytes.
crates/core/src/validation/mod.rs keeps the restorable_item module from main and the provisioned_limits module from this branch.
crates/server/src/authz_cache.rs keeps the policy owner that main adds to each parse error and the size limit that this branch passes to each policy loader.
crates/server/src/console/mod.rs keeps the secure_cookies field from main and the max_policy_document_bytes field from this branch.
crates/server/src/lib.rs sets both fields when it builds the console state: secure_cookies from main and max_policy_document_bytes from this branch.
…in added

Main added tests that call PolicyDocument::from_json_for_write with one argument, in the reference, Arn value and trust policy test files.
It also added a console test that builds a ConsoleState without the new field.
This branch gives from_json_for_write a second argument, the configured max_policy_document_bytes, and adds that field to ConsoleState.
The tests now pass DEFAULT_MAX_POLICY_DOCUMENT_BYTES, as the tests this branch changed before do, and the console test sets the field to the same default.
… index

Main gave GsiDescription two fields, warm_throughput and warm_throughput_record, for the WarmThroughput feature.
The index helper of the provisioned limits tests builds a GsiDescription by name, so it now sets both to None, as the backends do.
… size limit

Main added a session policy check to AssumeRole, PolicyDocument::from_json_for_session_policy, which parsed the document with the default limit of 6,144 bytes.
This branch parses a stored session policy on the request path with the configured max_policy_document_bytes.
With a key other than the default the two paths disagreed.
AssumeRole issued a session whose policy the request path then refused to load, or refused one that the request path loads.
from_json_for_session_policy now takes the limit, and AssumeRole passes the configured key from its state.
AssumeRole therefore accepts a session policy when the request path loads it.
A test checks that AssumeRole accepts a session policy at the configured limit and refuses one a byte over it.
handle_update_table read the table twice. The first read served the projected attribute total, the bare index update, the warm throughput and the on-demand switch checks. The second served the provisioned-capacity maxima. The capacity condition now joins the first condition. enforce_update_table runs last in that block on the same TableDescription, so the maxima still follow the other checks.

The doc comment of PolicyDocument::from_json names from_json_for_session_policy as the third path that parses with the configured max_policy_document_bytes.
crates/engine/src/lib.rs keeps the streams_iterator_params module from main and the table_limits module from this branch, in name order.
… maximum

provisioned_limits.rs built CapacityUnits from a ProvisionedThroughputDescription in five places, and Unit::table_max and Unit::account_max each converted a configured u64 maximum to i64.
CapacityUnits::of_description now reads a stored throughput, and Unit::limit converts the maximum of either unit.
The checks and their sentences do not change.
…aximum

check_update_table_capacity refused a unit over the per-table maximum only when the request raised it above what the table stored.
A switch to PAY_PER_REQUEST keeps the earlier figures in the stored ProvisionedThroughput.
So a table that stored 500 read units could return to PROVISIONED at 300 under a per-table maximum of 100.
An on-demand table now holds no units for this check, as table_capacity already counts it.
The new test row expects the per-table sentence for that switch. Before this change the check accepted the request.
Four assertions in provisioned_limits_tests.rs compared only the start of a refusal.
They now compare the full sentence with assert_eq!, as the measured-sentence tests above them do.
No test reached the limits through the handlers.
With both enforce_create_table and enforce_update_table removed, every engine test passed.

table_limits_tests.rs sends one table of rows to handle_create_table and handle_update_table, in order.
The context has an in-memory SQLite catalog, a quota of 3 tables, per-table maxima of 100 and account maxima of 150.
The rows are those of the manual run in the PR:

- an undefined key with 101 read units, refused for the key first
- the per-table and the account sentences on both operations
- a GSI create over the account maximum
- an accepted decrease
- the quota refusal, and a taken name at the quota

Each change below fails the test:

- no enforce_create_table call: the 101 RCU row
- no enforce_update_table call: the UpdateTable to 101 RCU row
- the CreateTable limits ahead of the definition checks: the undefined key row

The PartiQL test context is now visible to the whole crate, so the test reuses it.
The comment of enforce_create_table said that two concurrent requests could leave the account one table over the quota.
More requests can each pass the quota with one slot left. The account can then end over it by one table fewer than the number of those requests.
enforce_create_table returned Ok for a name that the account's list holds, and left the refusal to the backend.
A DeleteTable of that name between the list and the create then let the create through with no limit checked.
The review of 27 Nov 2026 raced the two requests under a per-table maximum of 100.
A table at 5000 read units got through in 3 of 3 runs on SQLite and 2 of 2 on PostgreSQL.

The limits read now answers the taken name itself, with the ResourceInUseException that the backend gives: `Table already exists: <name>`.
The answer comes before the limits, as before.
…able

ImportTable created its table with no limit checked.
In the review of 27 Nov 2026, an account at a quota of 5 tables imported two more at 50000 read and write units each.
That left 7 tables and 100000 read units, and the account could then create no provisioned table.

The import now calls enforce_create_table before it creates the table, after the checks of its path and file size.
So it gets the CreateTable answers: a taken name, the capacity maxima, then the table quota.
docs/dynamodb-limits.md now lists ImportTable among the operations that check the five limits.
RestoreTableFromBackup still checks none of them, as #1481 tracks.
…s test

No test reached a second ListTables page, so a read of the first 100 names only passed every test.
the_limits_read_every_page_of_the_account_tables stores 101 tables of 1 read unit each.
Then CreateTable at 2 read units gets the account sentence with 101 reserved, and at 1 read unit it creates the 102nd table.
The next table gets the quota sentence for 102 tables.
A read of the first page only fails the first and the last row.
The two account limits tests now send their requests through one helper, send.
…zation cache

a_stored_policy_over_the_configured_size_does_not_load read the user's inline policies only.
With the default size in place of the key in any other loader, the server tests passed.
The test now loads a stored policy through each of the six loaders that parse one.
It sets the key to the policy's size, then to one byte under it.
At the size each load succeeds. One byte under, each fails with the full parse failure message, which names the owner of the policy.
… startup

The shared test server runs with the default key of 6,144 bytes, so no wire test could tell the key from the default.
tests/test_policy_size_limit_sqlite.py serves a SQLite deployment of its own on 127.0.0.1 with the key at 400 bytes.
It sends a 401-byte and a 400-byte policy to four paths.
These are the management API for a user policy and for a permissions boundary, the console's policy page, and AssumeRole as a session policy.
Each refuses the 401-byte policy with its full sentence and accepts the 400-byte one.
Then the server restarts with the key at 300 bytes. It denies the requests of a user and of a session that hold 400-byte policies.
After a restart at 400 bytes, it allows them again.
The file imports the deployment class of test_allow_credential_import_sqlite.py and the console session class of test_console_cache_coherence.py.
The v1.1.0 release of 27 Nov 2026 does not hold this change, so the entry now has a v1.2.0 heading.
It sits after main's v1.2.0 entries, which are newest first.
The entry now names ImportTable, and it says that the per-table maximum applies to the table and to each index on its own.
Two earlier refusals come before the maxima: a table that is not ACTIVE, and an index Create that names an index the table holds.
RestoreTableFromBackup is the one operation left that checks none of the limits (#1481).
…ization cache

The format check of CI failed on four hunks in three test files.
The commits after the merge of main added them, in provisioned_limits_tests.rs, table_limits_tests.rs and authz_cache.rs.
This commit applies cargo fmt to them and changes nothing else.
…t index

check_table_max had one caller, the loop of check_create_table_capacity over the table and each index.
Its loop over the two units now sits in that loop.
The engine test built the same index gix in create_with_index and in index_create, and gix() now builds it for both.
No answer changes.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
#831's branch merged main and now checks a CreateTable's table and each index against the per-table maximum on their own, with the per-index sentence.
crates/core/src/validation/provisioned_limits.rs takes that check from #831, so check_create_table_indexes of this branch goes.
It keeps check_table_capacity_bounds and MAX_TABLE_CAPACITY_UNITS from this branch.
crates/engine/src/table_limits.rs makes the one call of #831.
The test helper capacity_checks of this branch passes the request to check_create_table_capacity, as #831's signature takes it.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The sum of the units of a CreateTable wrapped past 9223372036854775807.
An index at 9223372036854775807 beside a table at 5 then got the per-index sentence, which is DynamoDB's answer.
Other rules give that answer too.
The rows that would tell them apart are CreateTable requests, and no one has sent them to DynamoDB.
The sum now saturates at 9223372036854775807 again, as on #831's branch.

The measured row of an index at 9223372036854775808 leaves CAPACITY_FIGURES and tests/test_capacity_figure_bounds.py.
ExtendDB now answers it with the account sentence and Requested: 9223372036854775807, where DynamoDB answers the per-index sentence.
the_units_of_a_create_table_are_summed_up_to_i64_max holds that row with the four figures of the review of 30 Nov 2026.
With a sum that wraps, the index at 9223372036854775803 and the two indexes at 4611686018427387904 get the per-index sentence instead, as the first row does.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
#831's branch adds one commit that formats three test files with cargo fmt.
The merge takes it with no conflict.
provisioned_limits_tests.rs merged on its own, and the other two files take #831's text.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
#831's branch inlines check_table_max into check_create_table_capacity and adds gix() to the engine limits test.
The merge takes both with no conflict.
check_table_capacity_bounds and MAX_TABLE_CAPACITY_UNITS of this branch stay as they were.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
the_units_of_a_create_table_are_summed_up_to_i64_max wrote a CreateTable body by hand.
It now builds them with provisioned_table, from #831's branch, and passes them to check_create_table_capacity like the file's other CreateTable tests.
The first row names the index figure as 9223372036854775807.
That is what the reader makes of 9223372036854775808, so the rows and their answers stay the same.
LeeroyHannigan added a commit that referenced this pull request Dec 3, 2026
The Breaking changes section of this PR lists two answers that a table
from an earlier release can get. RestoreTableFromBackup refuses a backup
of a table with a figure above 1000000000000. UpdateTable has to bring
such a figure into the bound. The upgrade manual had no entry for them.
The new v1.2.0 entry follows the entry of #831. It also names the
reading of a fraction and of a figure outside the 64-bit range, which
1.1.0 refused with SerializationException.
@LeeroyHannigan

Copy link
Copy Markdown
Collaborator Author

@demohan

The branch merged main at c057660 in 3c583fb, with a merge commit and no rebase. The four files you named conflicted:

  • crates/engine/src/partiql/test_context.rs builds its context on main's crate::test_context::context_on. The limits test now builds its own context on crate::test_context (7159789), so the PartiQL helper keeps main's pub(super).
  • crates/engine/src/update_table.rs reads the table for companion.is_some() from main and for raises_capacity from this branch.
  • crates/server/src/authz_cache.rs keys the session loader by access key, as main does, and keeps the size limit that this branch passes to it.
  • The upgrade manual keeps the ClientRequestToken entry where main moved it.

v1.1.0 shipped without this change, so b1deb7b gives the entry a ### v1.2.0: heading, after main's v1.2.0 entries. The entry now names ImportTable. It says that the maximum applies to the table and to each index on its own. It also says that two refusals come before the maxima, as in earlier releases. One is for a table that is not ACTIVE, and one for an index Create that names an index the table holds.

5f28cba fixes ImportTable, from your comment on crates/engine/src/import_export/files.rs:72. import_table calls enforce_create_table on the table's CreateTableInput before it creates the table. import_table_applies_the_account_limits runs imports at a quota of 1 table and a per-table maximum of 100 read units:

  • 101 read units get the per-table sentence.
  • 100 read units create the table.
  • The next table gets the quota sentence.
  • The taken name gets ResourceInUseException.

The test fails with the call taken out. docs/dynamodb-limits.md now says that ImportTable checks the five limits. RestoreTableFromBackup checks none of them and stays with #1481.

@LJMart11 LJMart11 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checked at bd27313 against the list from b2b4dc7.

The follow-up makes CreateTable check the table and each index against the per-table maximum separately, moves the table-status and taken-index-name refusals of UpdateTable ahead of the maxima, answers a taken table name from the limits read, and adds the quota and capacity checks to ImportTable. Confirmed on the head: each of those guards fails a test when removed (status check, taken-index check, the refuse_ahead_of_the_maxima call, the taken-name branch, the ImportTable call, the per-index check; one failing test each or more). The lib tests of core (1270), auth (540), engine (985) and server (528) pass under 1.94.0, and 19 SQLite pytest tests of table throughput and UpdateTable billing validation pass. The base tip equals the merge base, so no base movement was merged.

Previous items: 2 fixed.

Main is at 5826e1b, three commits past c057660: #1531, #1466 and
#1087. In docs/manuals/07-upgrade-manual.md, #1531 adds a v1.2.0 entry
at the top of "Behavior Changes by Release", and git merged it with no
conflict. #1087 adds its v1.2.0 entry after the other v1.2.0 entries of
main, where this branch has its entry. That is the one conflict. The
merge keeps both entries without change: the entry of #1087 first, then
the entry of this branch, before the v1.1.0 entries. No other file has
changes on both sides.
@LJMart11

LJMart11 commented Dec 4, 2026

Copy link
Copy Markdown

Checked at bd27313 against the list from b2b4dc7. The head moved again to 0d53c9e; this reviewer stops after two rounds and leaves the rest to a person.

Fixed:

  • item 2

Disputed: none.

Needs-human: none.

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.

Four [limits] keys are accepted and not read or enforced

3 participants