Skip to content

fix(memory): refused UpdateTable and TagResource requests change nothing - #119

Merged
kalaspuff merged 1 commit into
issues-stack/4-batch-collection-metricsfrom
issues-stack/5-atomic-table-updates
Oct 31, 2026
Merged

kalaspuff merged 1 commit into
issues-stack/4-batch-collection-metricsfrom
issues-stack/5-atomic-table-updates

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What and why

DynamoDB applies nothing of a request it refuses, but the in-memory DynamoDB validated parts of UpdateTable after applying others. It set the billing mode and created and backfilled a new global index before checking the stream specification, so billing_mode=PROVISIONED with throughput together with re-enabling an enabled stream failed but left the table provisioned, and a GSI creation with the same stream error left the index in place. billing_mode=PROVISIONED without throughput failed after switching the table, leaving it provisioned without capacity, so every later UpdateTable failed the same way, even deletion_protection_enabled=True. An unknown index in a throughput update failed after the earlier settings were applied. TagResource added the tags before checking the 50-tag limit: 45 tags plus 10 raised LimitExceededException, and ListTagsOfResource then returned 55.

UpdateTable now validates the whole request (billing and throughput, every index update, the stream) before it changes the table, with the same checks, messages and order as before, and then applies it. TagResource checks the limit first, counting only keys the table does not have yet, since tags with existing keys replace their values.

Verified with memory backend tests that send each of these refused requests and compare the table description before and after, then make a later update, and that tag 45 + 6 new keys (refused, 45 left) and then 10 keys of which 5 exist (accepted, 50); both fail without the fix. make check passes.

Fixes #92

Checklist

  • Tests cover the change (memory backend; the requests are refused in DynamoDB too)
  • Docs updated (changelog)
  • make check passes locally (lint, types, clippy, consistency, tests)
  • Breaking change? No

fctl session


Note

Low risk. It only touches the in-memory test backend's UpdateTable and TagResource, and only for requests that are refused; accepted requests behave as before.

What it does. The in-memory DynamoDB applied parts of an UpdateTable or TagResource request (billing mode, a new global index, the tags) before it found an error later in the same request, so a refused request still changed the table. update_table now validates the whole request before it changes anything, and tag_resource checks the 50-tag limit before it adds tags, counting only keys that are new. Tests cover each refused case, and the changelog is updated.

fctl review's first look at c06c180 · 4 files, +165 −62 · Review agent settings

DynamoDB applies nothing of a request it refuses. The in-memory backend
set the billing mode, and created and backfilled a new global index,
before validating the rest of an UpdateTable request, so a later error
(an enabled stream enabled again, an unknown index) left those changes
applied. billing_mode=PROVISIONED without throughput left the table
provisioned without capacity, and every later UpdateTable failed the
same way. TagResource added the tags before checking the 50-tag limit.

Both now validate the whole request before they change the table.

Fixes #92

Co-authored-by: Carl Oscar Aaro <[email protected]>
@kalaspuff
kalaspuff added this pull request to stack #124 October 31, 2026 01:30
@kalaspuff
kalaspuff merged commit 39ed821 into main Oct 31, 2026
22 checks passed
@kalaspuff
kalaspuff deleted the issues-stack/5-atomic-table-updates branch October 31, 2026 01:34
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.

In-memory control plane: a failed UpdateTable or TagResource leaves earlier changes applied

1 participant