diff --git a/server/etcdserver/apply/apply.go b/server/etcdserver/apply/apply.go index e45d53e17b1..684c2ca9603 100644 --- a/server/etcdserver/apply/apply.go +++ b/server/etcdserver/apply/apply.go @@ -415,7 +415,6 @@ func (a *applierMembership) ClusterVersionSet(r *membershippb.ClusterVersionSetR prevVersion := a.cluster.Version() newVersion := semver.Must(semver.NewVersion(r.Ver)) a.cluster.SetVersion(newVersion, api.UpdateCapability, shouldApplyV3) - // Force snapshot after cluster version downgrade. if prevVersion != nil && newVersion.LessThan(*prevVersion) { lg := a.lg if lg != nil { @@ -424,8 +423,9 @@ func (a *applierMembership) ClusterVersionSet(r *membershippb.ClusterVersionSetR zap.String("new-cluster-version", newVersion.String()), ) } - a.snapshotServer.ForceSnapshot() } + // Force snapshot when cluster version changes. + a.snapshotServer.ForceSnapshot() } func (a *applierMembership) ClusterMemberAttrSet(r *membershippb.ClusterMemberAttrSetRequest, shouldApplyV3 membership.ShouldApplyV3) { diff --git a/tests/e2e/utl_migrate_test.go b/tests/e2e/utl_migrate_test.go index 7cc18e65353..3a77bc380b2 100644 --- a/tests/e2e/utl_migrate_test.go +++ b/tests/e2e/utl_migrate_test.go @@ -90,16 +90,10 @@ func TestEtctlutlMigrate(t *testing.T) { expectStorageVersion: &version.V3_6, }, { - name: "Downgrade v3.6 to v3.5 should fail until it's implemented", + name: "Downgrade v3.6 to v3.5 should work", targetVersion: "3.5", - expectLogsSubString: "cannot downgrade storage, WAL contains newer entries", - expectStorageVersion: &version.V3_6, - }, - { - name: "Downgrade v3.6 to v3.5 with force should work", - targetVersion: "3.5", - force: true, - expectLogsSubString: "forcefully cleared storage version", + expectLogsSubString: "updated storage version", + expectStorageVersion: nil, // 3.5 doesn't have the field `storageVersion`, so it returns nil. }, { name: "Upgrade v3.6 to v3.7 with force should work",