Skip to content

Commit

Permalink
Fix min observer
Browse files Browse the repository at this point in the history
  • Loading branch information
l0kix2 committed Jan 9, 2025
1 parent d7bf1b5 commit 9d129ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions controllers/ytsaurus_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ func prepareTest(t *testing.T, namespace string) *testutil.TestHelper {
return h
}

func waitClusterState(h *testutil.TestHelper, expectedState ytv1.ClusterState, expectedObservedGeneration int64) {
func waitClusterState(h *testutil.TestHelper, expectedState ytv1.ClusterState, minObservedGeneration int64) {
h.Logf("[ Wait for YTsaurus %s state ]", expectedState)
testutil.FetchAndCheckEventually(
h,
ytsaurusName,
&ytv1.Ytsaurus{},
fmt.Sprintf("cluster state is %s, gen is %d", expectedState, expectedObservedGeneration),
fmt.Sprintf("cluster state is %s, gen is %d", expectedState, minObservedGeneration),
func(obj client.Object) bool {
state := obj.(*ytv1.Ytsaurus).Status.State
observedGen := obj.(*ytv1.Ytsaurus).Status.ObservedGeneration
return state == expectedState && observedGen == expectedObservedGeneration
return state == expectedState && observedGen >= minObservedGeneration
},
)
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/components/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func NewMaster(cfgen *ytconfig.Generator, ytsaurus *apiproxy.Ytsaurus) *Master {
ytsaurus.APIProxy(),
ytsaurus,
resource.Spec.ImagePullSecrets,
"enable-real-chunks",
"enableRealChunks",
consts.ClientConfigFileName,
jobImage,
cfgen.GetNativeClientConfig,
Expand Down Expand Up @@ -322,12 +322,12 @@ func (m *Master) doSync(ctx context.Context, dry bool) (ComponentStatus, error)
if m.ytsaurus.GetUpdateState() == ytv1.UpdateStateWaitingForMasterExitReadOnly {
return m.exitReadOnly(ctx, dry)
}
if status, err := handleUpdatingClusterState(ctx, m.ytsaurus, m, &m.localComponent, m.server, dry); status != nil {
return *status, err
}
if m.ytsaurus.GetUpdateState() == ytv1.UpdateStateWaitingForEnableRealChunkLocations {
return m.restartEnableRealChunksJob(ctx, dry)
}
if status, err := handleUpdatingClusterState(ctx, m.ytsaurus, m, &m.localComponent, m.server, dry); status != nil {
return *status, err
}
}

if m.NeedSync() {
Expand Down

0 comments on commit 9d129ca

Please sign in to comment.