Fix the Days=0 expiration flake by publishing backlog metrics every 5s in CI - #2477
Fix the Days=0 expiration flake by publishing backlog metrics every 5s in CI#2477delthas wants to merge 2 commits into
Conversation
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
|
#2461 (comment) 180 to 420 seems huge and can hide some performance change or bugs. Do we need to be that high ? If yes, why ? can 300 can be enough (one gated batche) ? How did you choose 420 and validated it ? Did you try lower value ? |
I was gonna say something similar : The CI platform is not overloaded at all (last kafka cleaner test says we have ~1000 messages generated during the whole cucumber ci, for all kafka topics). Considering the traffic is so low on the test platform, I think it's better to question any test that takes more than a few seconds and review our backbeat code if it takes more than that 🤔 |
Temporary: the backlogMetricsIntervalSeconds field the next commit sets only exists in zenko-operator PR #626, so CI needs that build to have it honoured rather than silently pruned by the CRD. Replace with the release tag once #626 is merged and released. Issue: ZENKO-5337
The lifecycle conductor refuses to start a batch until three checks all report zero lag, and it can only see consumer progress through offsets published to ZooKeeper every backlogMetrics.intervalS, discarding nodes older than twice that interval. At the operator default of 60s the conductor stays blind to an idle cluster for 60-120s per batch. Measured in CI, with the conductor cron already firing every 5s: a batch pushed its entries in 1.3s, then every tick for the next ~115s logged "skipping lifecycle batch due to previous operation still in progress". Days=0 on a versioned bucket needs three sequential batches, so it spent 319.6s doing about 4s of work. Publishing every 5s bounds each gap at 5-10s instead. Production keeps the 60s default; the extra ZooKeeper writes are irrelevant at CI scale. Issue: ZENKO-5337
22fff19 to
e6b070d
Compare
| dashboard: zenko-operator/zenko-operator-dashboards | ||
| image: zenko-operator | ||
| tag: v1.8.14 | ||
| tag: c05e662bff3ca6e34ea321a8a20c4bbfc1b0beeb |
There was a problem hiding this comment.
Tag must be a concrete released tag, not a commit SHA (c05e662b...). The PR description notes this must be replaced before merge — flagging so it doesn't slip through. Update to the zenko-operator release tag once scality/zenko-operator#626 is merged and released.
e6b070d to
097309c
Compare
|
Do not merge yet — this now has a hard dependency on a backbeat fix. A follow-up 30-run census turned up something that makes this change harmful in the wrong order. The interval fix is verified and does exactly what it should, but by making lifecycle batches fire sooner it moves the cold-status message produce from a median of 99.5 s after the workflow step to 24 s — which lands it inside the window where a backbeat rolling update has left the consumer group with no member. The cold-status consumers never pin Measured across both censuses:
The per-stratum skip hazard is unchanged between the two (~55–67 % inside the window, ~4–9 % outside), so this isn't a new bug — it's the same latent one firing far more often because the exposure changed. Null control: batches produced far from any rollout window are skipped 0/94 and 1/70 (p = 0.43). So the ordering has to be: cold-status consumers get Recorded on ZENKO-5337 and ZKOP-569, both of which are now linked as blocked by the backbeat ticket. The WIP Issue: ZENKO-5337 |
Supersedes two earlier versions of this PR. The first raised the scenario budget 180 s → 420 s; @DarkIsDude and @SylvainSenechal objected that such a budget hides performance regressions, and they were right. This version changes no budget at all — it fixes the cause, and the scenario simply gets fast.
What the 320 s was actually spent on
Not the platform being slow, and not the conductor cron — CI already runs it every 5 s (
*/5 * * * * *, six fields). From a CI conductor log:LifecycleConductor._controlBacklogwon't start a batch until three checks all report zero lag. It can't read Kafka directly — it reads offsets published to ZooKeeper everybacklogMetrics.intervalS, and discards nodes older than 2× that interval. At the operator's default of 60 s the conductor is blind to an idle cluster for 60–120 s per batch.Days=0on a versioned bucket needs three sequential batches, so it spent 319.6 s doing about 4 s of work.The fix, and what it measured
spec.backbeat.backlogMetricsIntervalSeconds: 5bounds each gap at 5–10 s. Measured across a 30-run census on this change:Flake rate went from 7/30 (23 %) to 2/20 (10 %).
The budget stays at 180 s deliberately. It still catches the regression that matters — if the interval ever stopped applying, the scenario would take ~320 s and fail — while leaving room for the residual below. Lowering it further would have bought nothing and risked false alarms.
The residual 2 failures are a different bug
Investigated in the census dumps: they are not conductor stalls. The lifecycle pipeline loses its Kafka partition assignment entirely for 50–90 s, because on each rollout the outgoing backbeat pod never leaves the consumer group and the coordinator elects an already-SIGTERMed process as leader, so no assignment arrives until
session.timeout.msevicts it. Those runs needed 135–145 s end to end — under the 180 s this PR keeps. The rollouts themselves are the operator re-rendering every backbeat deployment on each location CRUD (ZKOP-568).Sequencing, and the WIP commit
The CR field is new (ZKOP-569 / scality/zenko-operator#626). Kubernetes silently prunes unknown CR fields, so against operator
v1.8.14this would be a no-op. The first commit therefore pointsdeps.yamlat the operator build for #626's head, and must be replaced with the release tag before this merges.Issue: ZENKO-5337