Skip to content

fix(rds): persist Copy/Modify/Restore extras + activity-stream + PI fields (bug-hunt)#2298

Open
vieiralucas wants to merge 2 commits into
mainfrom
bh-rds-extras
Open

fix(rds): persist Copy/Modify/Restore extras + activity-stream + PI fields (bug-hunt)#2298
vieiralucas wants to merge 2 commits into
mainfrom
bh-rds-extras

Conversation

@vieiralucas

@vieiralucas vieiralucas commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

A cluster of RDS Copy*/Modify*/Restore* "extras" ops returned canned/hardcoded XML but never persisted to state, so a subsequent Describe showed nothing (or a default). Their cluster-level analogs already persisted correctly a few hundred lines away in the same file. This mirrors that persistence pattern so every op round-trips through its Describe.

Behavior-only fix. No SDK/doc/operation-count surface change.

HIGH

  • CopyDBSnapshot now reads the source DBSnapshot, clones it (including dump data) into state.snapshots under the target id, and renders from the persisted record. DescribeDBSnapshots --db-snapshot-identifier <target> now returns the copy instead of DBSnapshotNotFoundFault.

MEDIUM

  • CopyDBParameterGroup persists the copy into state.parameter_groups.
  • ModifyDBSnapshotAttribute / DescribeDBSnapshotAttributes persist the attribute set (e.g. restore add/remove values) on the snapshot and read it back; rejects a value present in both add and remove lists. ModifyDBSnapshot now applies EngineVersion/OptionGroupName.
  • ModifyCurrentDBClusterCapacity applies the requested Capacity to the cluster and echoes real values (was hardcoded CurrentCapacity=4 + cluster id x); the capacity round-trips through DescribeDBClusters.
  • EnableHttpEndpoint / DisableHttpEndpoint write HttpEndpointEnabled onto the cluster (via ResourceArn) the same way ModifyDBCluster does; DescribeDBClusters reflects it. Unknown resource returns the declared ResourceNotFoundFault.
  • RestoreDBClusterFromS3 creates + persists a real cluster (was empty <DBCluster/>).
  • ModifyDBInstance now applies MonitoringRoleArn, PerformanceInsightsKMSKeyId, PerformanceInsightsRetentionPeriod (their companions were already applied).

LOW

  • ModifyDBSubnetGroup applies DBSubnetGroupDescription.
  • ModifyDBShardGroup / CreateDBShardGroup persist MaxACU/MinACU/ComputeRedundancy.
  • StartActivityStream / StopActivityStream / ModifyActivityStream persist an activity-stream status/mode/kms/kinesis onto the DB instance (new DbInstance::activity_stream field) or Aurora cluster named by ResourceArn, rendered by DescribeDBInstances/DescribeDBClusters (was hardcoded <ActivityStreamStatus>stopped). ModifyActivityStream/HTTP-endpoint ops now return only Smithy-declared error shapes.

State-struct change: added DbInstance::activity_stream (+ ActivityStreamConfig) and DbSnapshot::snapshot_attributes; swept all constructors repo-wide (including fakecloud-cloudformation).

Test plan

  • New unit/integration round-trip tests in crates/fakecloud-rds/src/service_tests.rs and extras/tests.rs: copy-then-describe, modify-attribute-then-describe, enable-http-endpoint-then-describe, capacity echo + describe round-trip, restore-from-s3, shard-group capacity, activity-stream persist, PI/monitoring-role apply, subnet-group description.
  • New E2E in crates/fakecloud-e2e/tests/rds_extras_persistence.rs (real AWS SDK, container-free): http endpoint, capacity, copy param group, restore-from-s3, activity stream on a cluster, subnet-group description. All 6 pass.
  • cargo nextest run -p fakecloud-rds — 255 passing.
  • cargo clippy -p fakecloud-rds --all-targets -- -D warnings clean; cargo fmt.
  • Conformance check PASSED with no regressions; RDS moved from 5487/5487 baseline to 5500/5518 with every changed op at 100% (fixed an initial regression where http-endpoint/activity-stream ops returned undeclared error shapes).

Summary by cubic

Fixes RDS extras so Copy/Modify/Restore operations persist to state and round-trip through Describe, and makes activity stream and performance insights settings stick. Removes canned responses, returns correct error shapes, and improves parity with AWS.

  • Bug Fixes

    • Snapshots: CopyDBSnapshot now clones the source into state (handles KMS/OptionGroup; no inherited share attrs); ModifyDBSnapshot applies EngineVersion/OptionGroupName; ModifyDBSnapshotAttribute persists the restore set and rejects values present in both add/remove; DescribeDBSnapshotAttributes returns saved attributes.
    • Parameter Groups: CopyDBParameterGroup persists the target group with description/family.
    • Clusters: ModifyCurrentDBClusterCapacity writes Capacity and echoes real values; Enable/DisableHttpEndpoint persist HttpEndpointEnabled by ResourceArn and return ResourceNotFoundFault for unknown ARNs; RestoreDBClusterFromS3 creates a real, describable cluster.
    • Instances: ModifyDBInstance applies MonitoringRoleArn, PerformanceInsightsKMSKeyId, and PerformanceInsightsRetentionPeriod.
    • Subnet/Shards: ModifyDBSubnetGroup updates DBSubnetGroupDescription; Create/ModifyDBShardGroup persist MaxACU/MinACU/ComputeRedundancy; RebootDBShardGroup echoes the stored group.
    • Activity Stream: Start/Stop/Modify persist stream status/mode/kms/kinesis on the targeted cluster or instance; DescribeDBClusters/DescribeDBInstances reflect it; ModifyActivityStream uses only declared error shapes.
  • Migration

    • State additions: DbInstance::activity_stream and DbSnapshot::snapshot_attributes. Constructors updated across crates and tests to default activity_stream to None. No SDK or operation surface changes.

Written for commit b23b1f4. Summary will update on new commits.

Review in cubic

@vieiralucas vieiralucas requested a review from Copilot July 16, 2026 12:42

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

CI test build (fakecloud bin --tests) failed E0063: the ctor sweep for the
new DbInstance.activity_stream field missed two #[cfg(test)] initializers in
the server bin (reset.rs seed + introspection.rs test). Both set None.
@vieiralucas vieiralucas requested a review from Copilot July 16, 2026 13:13

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants