mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(rds): reject cluster snapshot copies with missing data (#8908)
CopyDBClusterSnapshot no longer treats a missing stored archive as an empty dump and reports the copy available. It now fails with DBClusterSnapshotNotFoundFault before writing the target's metadata or data, as RestoreDBClusterFromSnapshot and snapshot export already do, while a present archive, an empty one included, is copied as before. Closes #7679
This commit is contained in:
1 parent
c2d285ed2f
commit
127b412414
2 files changed
+44
-1
No files matched your search
@@ -2717,7 +2717,9 @@ public class RdsService implements Resettable, ResourceProvider {
|
||||
copiedTags.putAll(tags);
|
||||
}
|
||||
copy.setTags(copiedTags);
|
||||
String sqlDump = snapshotData.get(clusterSnapshotDataKey(effectiveRegion, sourceId)).orElse("");
|
||||
String sqlDump = snapshotData.get(clusterSnapshotDataKey(effectiveRegion, sourceId))
|
||||
.orElseThrow(() -> new AwsException("DBClusterSnapshotNotFoundFault",
|
||||
"DB cluster snapshot data for " + sourceId + " not found.", 404));
|
||||
snapshotData.put(clusterSnapshotDataKey(effectiveRegion, targetSnapshotId), sqlDump);
|
||||
putClusterSnapshotForScope(accountId, effectiveRegion, targetSnapshotId, copy);
|
||||
LOG.infov("Copied DB cluster snapshot {0} to {1}", sourceId, targetSnapshotId);
|
||||
|
||||
Reference in new issue
Block a user