Skip to content

Commit 0ee0d85

Browse files
author
lamai93
committed
WaitForMember invalidates sync status at end.
1 parent 8749bfa commit 0ee0d85

File tree

2 files changed

+11
-19
lines changed

2 files changed

+11
-19
lines changed

pkg/deployment/reconcile/action_context.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ type ActionContext interface {
8484
// SetCurrentImage changes the CurrentImage field in the deployment
8585
// status to the given image.
8686
SetCurrentImage(imageInfo api.ImageInfo) error
87+
// InvalidateSyncStatus resets the sync state to false and triggers an inspection
88+
InvalidateSyncStatus()
8789
}
8890

8991
// newActionContext creates a new ActionContext implementation.
@@ -284,3 +286,8 @@ func (ac *actionContext) SetCurrentImage(imageInfo api.ImageInfo) error {
284286
}
285287
return nil
286288
}
289+
290+
// InvalidateSyncStatus resets the sync state to false and triggers an inspection
291+
func (ac *actionContext) InvalidateSyncStatus() {
292+
ac.context.InvalidateSyncStatus()
293+
}

pkg/deployment/reconcile/action_wait_for_member_up.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -167,26 +167,7 @@ func (a *actionWaitForMemberUp) checkProgressCluster(ctx context.Context) (bool,
167167
log.Debug().Str("status", string(sh.Status)).Msg("Member set status not yet good")
168168
return false, false, nil
169169
}
170-
if a.action.Group == api.ServerGroupDBServers {
171-
dbs, err := c.Databases(ctx)
172-
if err != nil {
173-
return false, false, err
174-
}
175-
for _, db := range dbs {
176-
inv, err := cluster.DatabaseInventory(ctx, db)
177-
if err != nil {
178-
return false, false, err
179-
}
180-
181-
for _, col := range inv.Collections {
182-
if !col.AllInSync {
183-
log.Debug().Str("col", col.Parameters.Name).Msg("Not in sync")
184-
return false, false, nil
185-
}
186-
}
187-
}
188170

189-
}
190171
// Wait for the member to become ready from a kubernetes point of view
191172
// otherwise the coordinators may be rotated to fast and thus none of them
192173
// is ready resulting in a short downtime
@@ -197,6 +178,10 @@ func (a *actionWaitForMemberUp) checkProgressCluster(ctx context.Context) (bool,
197178
log.Debug().Msg("Member not yet ready")
198179
return false, false, nil
199180
}
181+
182+
if a.action.Group == api.ServerGroupDBServers {
183+
a.actionCtx.InvalidateSyncStatus()
184+
}
200185
return true, false, nil
201186
}
202187

0 commit comments

Comments
 (0)