mirror of
https://github.com/floci-io/floci.git
synced 2026-11-29 00:21:51 -05:00
fix(rds): apply minor engine upgrades to backing databases (#8089)
Closes floci-io/floci#8007 Persist whether a standalone instance has never initialized its database. Protect engine versions before backend startup so runtime loss and proxy failures cannot expose existing storage to a metadata-only version change. Update SDK compatibility assertions to reject unsupported upgrades and verify resizing separately. Apply supported minor upgrades using the version-specific image on the existing volume and endpoint. Keep major upgrades, downgrades, and pinned-image changes blocked before mutation. Preserve the never-started case, report failed restarts honestly, and restore successful minor-upgrade coverage in the Java SDK compatibility suite.
This commit is contained in:
1 parent
1e45832d6b
commit
df1d850d71
6 files changed
+530
-43
No files matched your search
+15
-5
@@ -542,8 +542,8 @@ class RdsControlPlaneTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@DisplayName("ModifyDBInstance resizes and upgrades an instance, and Describe reports it")
|
||||
void sdkResizesAndUpgradesAStandaloneInstance() {
|
||||
@DisplayName("ModifyDBInstance applies minor upgrades and refuses major upgrades atomically")
|
||||
void sdkResizesAndAppliesMinorEngineUpgrades() {
|
||||
String instanceName = TestFixtures.uniqueName("rds-resize-db");
|
||||
try {
|
||||
createDbInstance(rds, instanceName, "resize-secret");
|
||||
@@ -557,6 +557,7 @@ class RdsControlPlaneTest {
|
||||
assertThat(modified.dbInstanceClass()).isEqualTo("db.t3.large");
|
||||
assertThat(modified.allocatedStorage()).isEqualTo(100);
|
||||
assertThat(modified.engineVersion()).isEqualTo("16.4");
|
||||
assertThat(modified.dbInstanceStatus()).isEqualTo("available");
|
||||
|
||||
DBInstance described = rds.describeDBInstances(b -> b.dbInstanceIdentifier(instanceName))
|
||||
.dbInstances().get(0);
|
||||
@@ -574,11 +575,20 @@ class RdsControlPlaneTest {
|
||||
.isInstanceOfSatisfying(RdsException.class, e -> assertThat(
|
||||
e.awsErrorDetails().errorCode()).isEqualTo("InvalidParameterCombination"));
|
||||
|
||||
DBInstance upgraded = rds.modifyDBInstance(b -> b
|
||||
assertThatThrownBy(() -> rds.modifyDBInstance(b -> b
|
||||
.dbInstanceIdentifier(instanceName)
|
||||
.dbInstanceClass("db.t3.xlarge")
|
||||
.allocatedStorage(200)
|
||||
.engineVersion("17.2")
|
||||
.allowMajorVersionUpgrade(true)).dbInstance();
|
||||
assertThat(upgraded.engineVersion()).isEqualTo("17.2");
|
||||
.allowMajorVersionUpgrade(true)))
|
||||
.isInstanceOfSatisfying(RdsException.class, e -> assertThat(
|
||||
e.awsErrorDetails().errorCode()).isEqualTo("InvalidParameterCombination"));
|
||||
|
||||
DBInstance afterRejectedUpgrades = rds.describeDBInstances(b -> b.dbInstanceIdentifier(instanceName))
|
||||
.dbInstances().get(0);
|
||||
assertThat(afterRejectedUpgrades.engineVersion()).isEqualTo("16.4");
|
||||
assertThat(afterRejectedUpgrades.dbInstanceClass()).isEqualTo("db.t3.large");
|
||||
assertThat(afterRejectedUpgrades.allocatedStorage()).isEqualTo(100);
|
||||
} finally {
|
||||
deleteDbInstance(rds, instanceName);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user