Skip to content

Metrics switchover#264

Merged
teem0n merged 6 commits into
masterfrom
metrics_switchover
Jun 10, 2026
Merged

Metrics switchover#264
teem0n merged 6 commits into
masterfrom
metrics_switchover

Conversation

@dodokek

@dodokek dodokek commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Write info about switchover timings and other rare stuff

@dodokek dodokek force-pushed the metrics_switchover branch 3 times, most recently from 19cefbd to c52c7ef Compare June 5, 2026 10:59
@dodokek dodokek force-pushed the metrics_switchover branch from 55554ab to ee634d0 Compare June 7, 2026 10:40
Comment thread internal/app/timing_tracker.go Outdated
Comment thread internal/app/timing_tracker.go Outdated
if since.IsZero() {
since = start
}
app.logTiming(timingSwitchover+"_failure", -time.Since(since))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should call time.Since in the very beginning of the method

Otherwise, we will measure switchover time + 2 zk calls (getTimingStart + clearTiming), and this may take a non-zero time

Comment thread internal/app/app_dcs.go
app.logger.Info().Msgf("switchover: %s => %s starting...", switchover.From, switchover.To)
switchover.StartedAt = time.Now()
switchover.StartedBy = app.config.Hostname
if switchover.MasterTransition == SwitchoverTransition {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switchover may be started from external source

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at InitiatedAt field then

Comment thread internal/app/app_dcs.go Outdated
@teem0n teem0n merged commit 6ed20f9 into master Jun 10, 2026
121 of 122 checks passed
@teem0n teem0n deleted the metrics_switchover branch June 10, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants