Skip to content

fix(streams, update-table): CreationRequestDateTime; measured UpdateTable sentences and validation order - #548

Open
LeeroyHannigan wants to merge 2 commits into
mainfrom
fix/517-519-520-stream-update-table-sentences
Open

LeeroyHannigan wants to merge 2 commits into
mainfrom
fix/517-519-520-stream-update-table-sentences

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

Summary

Three measured sentence and shape fixes on the stream and UpdateTable paths, found while reviewing #515. Every expected answer was measured on Amazon DynamoDB on 2026-10-24 and 2026-10-25; the rows are in the wire tests.

Closes #517, closes #519, closes #520.

Change

#517. DescribeStream returns CreationRequestDateTime on every stream, enabled or disabled; ExtendDB omitted it on every backend. The value is derived from the stream label: stream_label_creation_date_time (crates/storage/src/util/arn.rs) parses the 23-byte label every backend writes today and the 19-byte label SQLite, PostgreSQL and MongoDB wrote on v0.1.3 to v0.1.13 and Cassandra up to v0.1.14, so a stream enabled on those versions and never re-enabled reports the member too. The engine sets it in handle_describe_stream, the one response-boundary site, so all four backends return it. On the service the member is a stored request time that preceded the label's instant by 0 to 13 ms in three measurements; on ExtendDB the two name the same millisecond.

#519. UpdateTable with StreamEnabled: true and no StreamViewType now answers the service's If stream is being enabled then UpdateViewType is required. The service reports a defective GSI Create and a PROVISIONED billing mode without throughput before the missing view type, and the view type before the table lookup; the check moved to after the billing and index rules. The throughput sentence is now the service's ProvisionedThroughput must be specified when BillingMode is PROVISIONED (ExtendDB said when changing BillingMode to PROVISIONED).

#520. A GSI Create whose key attribute is not in AttributeDefinitions gets one of three sentences by the member's shape: absent, AttributeDefinitions is not specified for index: <name> (the first Create in request order, even when the key is the table's own hash key); present and lacking the key, the Keys: [..], AttributeDefinitions: [..] sentence; present and empty, Invalid KeySchema: Some index key attribute have no definition. ExtendDB rendered the second for every shape. The CreateTable path is untouched; it has its own copy of the check in crates/core.

The update_table unit tests moved to crates/engine/src/update_table_tests.rs unchanged (the file had crossed 600 lines).

Tests

Measured, not changed here

  • The Keys: [..] and AttributeDefinitions: [..] lists: on the service Keys carries every key of the index (not the missing one), two missing keys with a non-empty member is Invalid KeySchema, and both lists come out in an order that is neither the request's nor alphabetical. Pre-existing on both the CreateTable and UpdateTable paths; filed separately. The rows here use one-key shapes where the order does not arise.
  • AttributeDefinitions that redefines the table's own key with another type is accepted by the service, which keeps the original type; a duplicated definition is refused with Attribute Name is duplicated: <name>. ExtendDB accepts both. Filed separately.

Merge notes for #515

Six files conflict with fix/482-stream-disable-closes-shards; the resolution: drop #515's inline enable check in handle_update_table (this branch's validate_stream_specification carries the measured sentence and runs after the index rules) and keep #515's disable rule after it; keep both validate_stream_specification and stream_change_companion; union the two test blocks in update_table_tests.rs; take #515's side for the four backend describe_stream bodies and add creation_request_date_time: None, to the one StreamDescription literal in stream_lineage.rs. After both land: stream_lineage::label_millis and stream_label_creation_date_time parse the same label, so one parser should define the shape and carry the 19-byte arm; #515's storage-side copy of the view-type rule still has the old sentence (unreachable, since the engine check runs first) and should take the measured one; and the #517 wire row gains assert desc["StreamStatus"] == "DISABLED" on the post-disable DescribeStream, which no backend answers before #515.

The service returns CreationRequestDateTime in StreamDescription on every
stream, enabled or disabled (measured 2026-10-24). ExtendDB omitted it on
every backend.

The value is derived from the stream label rather than stored.
stream_label_creation_date_time parses the 23-byte label format_stream_label
writes and the 19-byte label SQLite, PostgreSQL and MongoDB wrote on v0.1.3
to v0.1.13 and Cassandra up to v0.1.14, so a stream enabled on those
versions reports the member too. The engine sets the member in
handle_describe_stream, so all four backends return it. On the service the
member is a stored request time that preceded the label's instant by 0 to
13 ms in three measurements (2026-10-25); on ExtendDB the two name the same
millisecond.

Fixes #517
… GSI without definitions

UpdateTable StreamSpecification {StreamEnabled: true} with no StreamViewType
is refused by the service with "One or more parameter values were invalid:
If stream is being enabled then UpdateViewType is required" (measured
2026-10-24 on a never-streamed table and on a table whose stream is
enabled). ExtendDB said "StreamViewType must be specified when StreamEnabled
is true". The service reports a Create whose key attribute has no definition,
and a PROVISIONED billing mode with no ProvisionedThroughput, before the
missing view type, and the view type before the table lookup (measured
2026-10-25); the check now runs after the billing and index rules and before
the backend call. The throughput sentence is the service's:
"ProvisionedThroughput must be specified when BillingMode is PROVISIONED".

An UpdateTable GlobalSecondaryIndexUpdates Create whose key attribute is not
defined is refused by the service with one of three sentences by the shape
of AttributeDefinitions (measured 2026-10-25): member absent,
"AttributeDefinitions is not specified for index: <name>", naming the first
Create in request order; member present and lacking the key, "Some index key
attributes are not defined in AttributeDefinitions. Keys: [..],
AttributeDefinitions: [..]"; member present and empty, "Invalid KeySchema:
Some index key attribute have no definition". ExtendDB rendered the second
sentence for every shape. The UpdateTable check has its own rendering in the
engine and does not call core's CreateTable validation, so the CreateTable
sentence is unchanged.

The update_table tests move to update_table_tests.rs unchanged.

Fixes #519
Fixes #520

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

2 participants