Skip to content

Commit 833ec65

Browse files
authored
Improve team tracker checks when DD was restarted (#2100)
1 parent 1291561 commit 833ec65

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

e2e/fixtures/fdb_cluster.go

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,8 +1419,19 @@ func (fdbCluster *FdbCluster) UpgradeAndVerify(version string) {
14191419
// EnsureTeamTrackersAreHealthy will check if the machine-readable status suggest that the team trackers are healthy
14201420
// and all data is present.
14211421
func (fdbCluster *FdbCluster) EnsureTeamTrackersAreHealthy() {
1422-
gomega.Eventually(func() bool {
1423-
for _, tracker := range fdbCluster.GetStatus().Cluster.Data.TeamTrackers {
1422+
gomega.Eventually(func(g gomega.Gomega) bool {
1423+
// If the status is initializing the team trackers will be missing. This can happen in cases where e.g.
1424+
// the DD is restarted or when the SS are restarted. This state is only intermediate and will change once the
1425+
// DD is done analyzing the current state. If we are not checking for this state, we might see intermediate failures
1426+
// because of a short period where the DD is restarted and therefore the team trackers are empty.
1427+
if fdbCluster.GetStatus().Cluster.Data.State.Name == "initializing" {
1428+
return true
1429+
}
1430+
1431+
// Make sure that the team trackers are reporting.
1432+
teamTrackers := fdbCluster.GetStatus().Cluster.Data.TeamTrackers
1433+
g.Expect(teamTrackers).NotTo(gomega.BeEmpty())
1434+
for _, tracker := range teamTrackers {
14241435
if !tracker.State.Healthy {
14251436
return false
14261437
}
@@ -1434,9 +1445,21 @@ func (fdbCluster *FdbCluster) EnsureTeamTrackersAreHealthy() {
14341445
// match the expected replicas.
14351446
func (fdbCluster *FdbCluster) EnsureTeamTrackersHaveMinReplicas() {
14361447
desiredFaultTolerance := fdbCluster.GetCachedCluster().DesiredFaultTolerance()
1437-
gomega.Eventually(func() int {
1448+
gomega.Eventually(func(g gomega.Gomega) int {
14381449
minReplicas := math.MaxInt
1439-
for _, tracker := range fdbCluster.GetStatus().Cluster.Data.TeamTrackers {
1450+
// If the status is initializing the team trackers will be missing. This can happen in cases where e.g.
1451+
// the DD is restarted or when the SS are restarted. This state is only intermediate and will change once the
1452+
// DD is done analyzing the current state. If we are not checking for this state, we might see intermediate failures
1453+
// because of a short period where the DD is restarted and therefore the team trackers are empty.
1454+
if fdbCluster.GetStatus().Cluster.Data.State.Name == "initializing" {
1455+
return desiredFaultTolerance
1456+
}
1457+
1458+
// Make sure that the team trackers are reporting.
1459+
teamTrackers := fdbCluster.GetStatus().Cluster.Data.TeamTrackers
1460+
g.Expect(teamTrackers).NotTo(gomega.BeEmpty())
1461+
1462+
for _, tracker := range teamTrackers {
14401463
if minReplicas > tracker.State.MinReplicasRemaining {
14411464
minReplicas = tracker.State.MinReplicasRemaining
14421465
}

0 commit comments

Comments
 (0)