@@ -3416,8 +3416,6 @@ def update_replicas(
34163416
34173417 need_update_number_sync_standbys = True
34183418
3419- waiting_cluster_final_status (meta , spec , patch , status , logger , 1 * HOURS )
3420-
34213419 return need_update_number_sync_standbys
34223420
34233421
@@ -4103,20 +4101,25 @@ def update_cluster(
41034101 update_service (meta , spec , patch , status , logger , AC , FIELD , OLD ,
41044102 NEW )
41054103
4106- for diff in diffs :
4107- AC = diff [0 ]
4108- FIELD = diff [1 ]
4109- OLD = diff [2 ]
4110- NEW = diff [3 ]
4111-
4112- if update_toleration == False and waiting_cluster_final_status (meta , spec , patch , status , logger , except_nodes = except_nodes ) == False :
4113- logger .error (f"cluster status is not health." )
4114- raise kopf .PermanentError (f"cluster status is not health." )
4115-
4116- return_update_number_sync_standbys = update_replicas (meta , spec , patch , status , logger , AC , FIELD , OLD ,
4117- NEW )
4118- if need_update_number_sync_standbys == False and return_update_number_sync_standbys == True :
4119- need_update_number_sync_standbys = True
4104+ if update_toleration == False and waiting_cluster_final_status (meta , spec , patch , status , logger ,
4105+ except_nodes = except_nodes ) == False :
4106+ logger .error (f"cluster status is not health." )
4107+ raise kopf .PermanentError (f"cluster status is not health." )
4108+ else :
4109+ for diff in diffs :
4110+ AC = diff [0 ]
4111+ FIELD = diff [1 ]
4112+ OLD = diff [2 ]
4113+ NEW = diff [3 ]
4114+
4115+ return_update_number_sync_standbys = update_replicas (meta , spec , patch , status , logger , AC , FIELD , OLD ,
4116+ NEW )
4117+ if need_update_number_sync_standbys == False and return_update_number_sync_standbys == True :
4118+ need_update_number_sync_standbys = True
4119+
4120+ # update readwrite replicas or update readonly replicas need wait pg_basebackup
4121+ if need_update_number_sync_standbys :
4122+ waiting_cluster_final_status (meta , spec , patch , status , logger , 1 * HOURS )
41204123
41214124 for diff in diffs :
41224125 AC = diff [0 ]
0 commit comments