Skip to content

Commit af962ed

Browse files
committed
dev: add almost endless wait for replication lag catch
1 parent aa1d068 commit af962ed

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/controller/chi/worker-status-helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func (w *worker) doesHostHaveNoRunningQueries(ctx context.Context, host *api.Hos
8585

8686
func (w *worker) doesHostHaveNoReplicationDelay(ctx context.Context, host *api.Host) bool {
8787
delay, _ := w.ensureClusterSchemer(host).HostMaxReplicaDelay(ctx, host)
88+
log.V(1).Info("replication lag %d host: %s", delay, host.GetName())
8889
return delay <= chop.Config().Reconcile.Host.Wait.Replicas.Delay.IntValue()
8990
}
9091

pkg/controller/chi/worker-wait-exclude-include-restart.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ package chi
1616

1717
import (
1818
"context"
19-
"github.com/altinity/clickhouse-operator/pkg/interfaces"
2019
"time"
2120

2221
log "github.com/altinity/clickhouse-operator/pkg/announcer"
2322
api "github.com/altinity/clickhouse-operator/pkg/apis/clickhouse.altinity.com/v1"
2423
"github.com/altinity/clickhouse-operator/pkg/apis/common/types"
2524
"github.com/altinity/clickhouse-operator/pkg/chop"
25+
"github.com/altinity/clickhouse-operator/pkg/controller/common/poller"
2626
"github.com/altinity/clickhouse-operator/pkg/controller/common/poller/domain"
27+
"github.com/altinity/clickhouse-operator/pkg/interfaces"
2728
"github.com/altinity/clickhouse-operator/pkg/util"
2829
)
2930

@@ -506,7 +507,7 @@ func (w *worker) waitHostHasNoActiveQueries(ctx context.Context, host *api.Host)
506507

507508
// waitHostHasNoReplicationDelay
508509
func (w *worker) waitHostHasNoReplicationDelay(ctx context.Context, host *api.Host) error {
509-
return domain.PollHost(ctx, host, w.doesHostHaveNoReplicationDelay)
510+
return domain.PollHost(ctx, host, w.doesHostHaveNoReplicationDelay, &poller.Options{Timeout: time.Hour * 24 * 365 * 100})
510511
}
511512

512513
// waitHostRestart

0 commit comments

Comments
 (0)