Repository navigation
fix(memory): refused UpdateTable and TagResource requests change nothing - #119
Merged
kalaspuff merged 1 commit intoOct 31, 2026
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
DynamoDB applies nothing of a request it refuses, but the in-memory DynamoDB validated parts of
UpdateTableafter applying others. It set the billing mode and created and backfilled a new global index before checking the stream specification, sobilling_mode=PROVISIONEDwith 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=PROVISIONEDwithout throughput failed after switching the table, leaving it provisioned without capacity, so every laterUpdateTablefailed the same way, evendeletion_protection_enabled=True. An unknown index in a throughput update failed after the earlier settings were applied.TagResourceadded the tags before checking the 50-tag limit: 45 tags plus 10 raisedLimitExceededException, andListTagsOfResourcethen returned 55.UpdateTablenow 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.TagResourcechecks 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 checkpasses.Fixes #92
Checklist
make checkpasses locally (lint, types, clippy, consistency, tests)fctl session
Note
Low risk. It only touches the in-memory test backend's
UpdateTableandTagResource, and only for requests that are refused; accepted requests behave as before.What it does. The in-memory DynamoDB applied parts of an
UpdateTableorTagResourcerequest (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_tablenow validates the whole request before it changes anything, andtag_resourcechecks 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