fix(docdb): preserve indexes when restoring cluster snapshots (#9864)

A DocumentDB snapshot with users, roles and custom indexes could fail to
restore into a new cluster. The archive is now restored in two passes:
documents and indexes first, then the target's users and roles, so
indexes on application collections and on user-created collections in
admin survive. A target with no MongoDB backend to receive the archive
refuses the restore with InvalidRestoreFault, and a failed restore
discards only the cluster it created, checked by resource ID, so a
same-named replacement is left alone.

Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
Jackson PriceandAndre Kurait authored and GitHub committed 2026-11-30 21:47:30 -04:00
1 parent c10a20f328
commit 022873e1ef
8 files changed
+324 -19

No files matched your search

+4 -3
View File
@@ -205,7 +205,6 @@ starts EmrContainersGatewayNightlyIntegrationTest \
# package token in shard.txt -> images its tests are known to launch
# (measured inline pulls; update alongside image-catalog changes)
grep -q '/docdb/' "$SHARD_FILE" && pull mongo:7.0
configured_image() {
image="$(bash .github/ci/service-image.sh "$1" "$2")"
if [ -n "$image" ]; then
@@ -224,8 +223,10 @@ if starts NeptuneGraphVolumeDockerNightlyIntegrationTest NeptuneClusterRestartDo
configured_image neptune default-image
configured_image neptune default-neo4j-image
fi
# DocDbClusterRestartDockerNightlyIntegrationTest restarts clusters on the configured MongoDB image.
starts DocDbClusterRestartDockerNightlyIntegrationTest && configured_image docdb default-image
if starts DocDbClusterRestartDockerNightlyIntegrationTest DocDbClusterSnapshotDockerNightlyIntegrationTest \
|| grep -q '/docdb/' "$SHARD_FILE"; then
configured_image docdb default-image
fi
grep -q '/elasticache/' "$SHARD_FILE" && { pull valkey/valkey:8; pull memcached:1.6; }
grep -q '/memorydb/' "$SHARD_FILE" && pull valkey/valkey:8
grep -q '/ecr/' "$SHARD_FILE" && pull registry:2