feat(redshift-serverless): copy snapshots into the configured destination region (#7024)

* feat(redshift-serverless): copy snapshots into the configured destination region

A SnapshotCopyConfiguration used to be stored and echoed, with nothing copied.
A background sweep now carries each AVAILABLE snapshot of the namespace, taken
at or after the configuration was created, into the destination Region with its
dump and metadata. The copy is an ordinary snapshot there, so describe, restore,
delete and expiration work on it unchanged.

- The source records the Regions it has been copied to, so a deleted or expired
  copy is not made again and a retry or restart after a crash makes no second
  copy. A copy made for an earlier snapshot of the same name is replaced.
- Retention and KMS key come from the configuration. A name already taken by
  an unrelated snapshot in the destination is kept and logged.
- Rules carry the account and namespace id, so accounts never collide and a
  recreated namespace does not inherit its predecessor's configuration.
- The destination must be a known Region in the namespace's partition.
- ResetAll now removes every snapshot dump, which it used to leak.
- New switches: snapshot-copy-enabled and snapshot-copy-sweep-interval-seconds.

* fix(redshift-serverless): keep the earlier snapshot copy restorable when a replacement fails

Each copy now gets its own dump file and the replaced copy's dump is removed
only after the new record is saved. Drop the slow, partition-bound
compatibility test; the in-repo engine and integration tests cover the copy.

* fix(redshift-serverless): name a snapshot copy's dump by id so long snapshot names still copy
This commit is contained in:
Vũ Thế Huy authored and GitHub committed 2026-10-30 14:44:26 -04:00
1 parent fa243bf78e
commit 9b69b3dac3
14 files changed
+1241 -10

No files matched your search

@@ -454,7 +454,7 @@ class RedshiftServerlessTest {
@Test
void snapshotCopyDestinationCanChangeOnlyAfterDeletion() {
assumeFalse(TestFixtures.isRealAws(), "Asserts metadata-only snapshot copying");
assumeFalse(TestFixtures.isRealAws(), "Asserts emulator-local snapshot copy configuration rules");
try (RedshiftServerlessClient client = TestFixtures.redshiftServerlessClient()) {
String namespaceName = "floci-compat-copy-ns";
try {