Skip to content

Commit 47ee644

Browse files
committed
mysqlcluster: when storage size shrink, and change replicas, It will reconcile fail forever. #436
1 parent 7d05a4f commit 47ee644

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mysqlcluster/syncer/statefulset.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,10 @@ func (s *StatefulSetSyncer) canExpandPVC(ctx context.Context) bool {
167167
// If newStorage is not greater than oldStorage, do not expand.
168168
if newStorage.Cmp(*oldRequest.Storage()) != 1 {
169169
log.Info("canExpandPVC", "result", "can not expand", "reason", "new pvc is not larger than old pvc")
170-
return false
170+
// Should return true, because if change replicas and storage size, it will fail again and again
171+
// during expanding PVCs, not great then oldStorage it will not truely expand, just recreate
172+
// statefulset.
173+
return true
171174
}
172175
return true
173176
}

0 commit comments

Comments
 (0)