Skip to content

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

Open

Description

@LeeroyHannigan

Four [limits] keys are accepted by the configuration loader and documented, and the server does not act on them.

  • max_policy_document_bytes (crates/core/src/limits/mod.rs) has no reader. The policy document size check is PolicyDocument::from_json, which calls from_json_with_size_limit(json, 6_144) with a literal (crates/auth/src/policy/document.rs:157); both callers use from_json. Changing the key changes nothing.
  • max_tables_per_account is read only by the console settings page. CreateTable (crates/engine/src/create_table.rs) does not count the account's tables, so the limit is never enforced.
  • per_table_max_rcu and per_table_max_wcu are read only by DescribeLimits (crates/engine/src/describe_limits.rs), which reports them. Provisioned throughput validation (crates/core/src/validation/mod.rs) checks that each value is at least 1 and has no upper bound, so CreateTable and UpdateTable accept any value.

The configuration reference (#537) now describes each key as it behaves. This issue is the other half: either wire the keys (pass max_policy_document_bytes into from_json_with_size_limit on the write and read paths; count tables in CreateTable; bound provisioned throughput in validation) or remove them from LimitsConfig so an operator cannot set a limit that does nothing. The service rejects a table count above the account quota with LimitExceededException and a provisioned value above the per-table maximum with ValidationException; the messages are measured before any enforcement is written.

Found while checking every configuration key against the code that reads it, for #494.

Activity

  1. LeeroyHannigan commented on Oct 31, 2026

    @LeeroyHannigan
    CollaboratorAuthor

    Measured on Amazon DynamoDB on 2026-10-31 between 22:30 and 22:34 UTC in us-east-1, each request twice with the same answer. Every request was refused; no table was created or changed.

    On the account used, DescribeLimits reports a table maximum and an account maximum of 150,000 RCU and 200,000 WCU each, and the account had 61 RCU and 46 WCU reserved.

    Request Answer
    UpdateTable of an existing table's throughput to 150,001 RCU LimitExceededException: The requested ReadCapacityUnits, 150001, is above the per table maximum for the account in us-east-1. Per table maximum: 150000. Refer to the Amazon DynamoDB Developer Guide for current limits and how to request higher limits.
    the same at 200,001 WCU the same sentence with WriteCapacityUnits, 200001 and Per table maximum: 200000
    CreateTable at 150,001 RCU LimitExceededException: This request would have caused the ReadCapacityUnits limit to be exceeded for the account in us-east-1. Current ReadCapacityUnits reserved by the account: 61. Limit: 150000. Requested: 150001. Refer to the Amazon DynamoDB Developer Guide for current limits and how to request higher limits.
    CreateTable at 200,001 WCU the same sentence with WriteCapacityUnits, reserved by the account: 46, Limit: 200000 and Requested: 200001
    CreateTable with both over the RCU sentence
    UpdateTable with a GSI Create at 150,001 RCU, on a table with 1 RCU LimitExceededException: This request would have caused the ReadCapacityUnits limit to be exceeded for the account in us-east-1. Current ReadCapacityUnits reserved by the account: 61. Limit: 150000. Current ReadCapacityUnits provisioned for the table and indexes: 1. Requested: 150002. Refer to the Amazon DynamoDB Developer Guide for current limits and how to request higher limits.
    the same GSI at 200,001 WCU the WCU form of that sentence, with 46, 200000, 1 and 200002
    CreateTable naming an existing table, over either maximum ResourceInUseException: Table already exists: <name>
    CreateTable with a key that has no definition, over either maximum ValidationException: One or more parameter values were invalid: Some index key attributes are not defined in AttributeDefinitions. Keys: [pk], AttributeDefinitions: [x]

    So a provisioned value over the maximum answers LimitExceededException on every path measured. On CreateTable the definition checks come first, then the table's existence, then the capacity limit. Requested in the GSI sentence is the table and its indexes after the change.

    Two answers are not in these measurements:

    • CreateTable over the per-table maximum while the account stays under its maximum. On this account the two maxima are equal, so every such value also exceeds the account maximum and the account sentence answers.
    • The table count refusal, which needs an account at its table quota (2,500 on this account, 288 in use).

    Two more keys are in the same state as the four above: per_account_max_rcu and per_account_max_wcu (defaults 80,000) are read only by DescribeLimits (crates/engine/src/describe_limits.rs). docs/dynamodb-limits.md lists the per-table and per-account RCU and WCU limits as enforced.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions