Resynchronise count-items in the Quotas restore scenarios - #2478
Draft
delthas wants to merge 2 commits into
Draft
Conversation
Both restore scenarios upload the object and transition it to e2e-cold before any quota is set, and cloudserver skips utilization accounting entirely when no quota is set, so neither the PUT nor the hot-to-cold transition is visible to scuba. When the hourly count-items cron snapshots during that window it records the object as still hot, nothing corrects it, and the later restore reserves another 100 B: 200 > 101 and the request is rejected where the scenario expects success. 2 of 30 census runs failed this way, and they are exactly the 2 whose scenario window crossed the top of the hour; the 8 other analysed runs all passed. Rebuild the metrics after the transition with the step this file already uses twice, so the accounting describes a cold object before the quotas go in. Issue: ZENKO-5338
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
The count-items cronjob keeps running after the count completes, until either Prometheus scrapes its final metrics or the dwell expires (PROMETHEUS_POLLING_ATTEMPTS x PROMETHEUS_POLLING_PERIOD, 5 x 30s in s3utils). The operator puts a 60s interval on its ServiceMonitor by default, confirmed on a live cluster, so each run spends up to a minute idle after a few seconds of actual work. The suite triggers that job explicitly, once per metrics scenario setup and now also in the two restore scenarios. Those additions cost about 23 minutes of ctst wall time, 135 min against 112 min on a sibling branch; the excess over the sum of the job durations comes from the /tmp lock that serialises them, which makes waiting workers idle too. Scrape that one target every 5s in CI instead. spec.s3utils.metrics has a single consumer in the operator, the count-items ServiceMonitor, so nothing else changes cadence, and no behaviour under test is affected: the job still publishes its metrics, it just stops waiting to be asked. Issue: ZENKO-5338
delthas
force-pushed
the
improvement/ZENKO-5338/quotas-restore-count-items-resync
branch
from
August 5, 2026 09:49
da0e42d to
6a9322e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two quota restore scenarios fail when the hourly
count-itemscron snapshots at the wrong moment — 2 of 30 runs in the recent CTST census, surfacing as a 429 behind the unhelpfulExpected values to be strictly equal.Both scenarios upload the object and transition it to
e2e-coldbefore setting any quota, and cloudserver skips utilization accounting entirely while no quota exists. So a cron snapshot taken in that window records the object as still hot, nothing corrects it, and the later restore reserves another 100 B on top: 200 > 101, rejected. Of 10 census reports analysed, the 2 whose scenario window crossed the top of the hour failed and the other 8 passed.First commit — add the resync step this file already uses twice (
:122,:158) after the transition, so the accounting describes a cold object before the quotas go in. No new step definition.Second commit — pay for it. The resync was green on all three CI attempts but cost ~23 min of ctst wall time (135 min against 112 on a sibling branch), and almost none of that is work: count-items keeps running after counting until Prometheus scrapes its final metrics, and the operator gives its ServiceMonitor a 60 s interval (confirmed on a live cluster), so each run idles up to a minute. The test helper also serialises these runs behind a lock, so waiting workers idle too. Scraping that one target every 5 s caps the tail —
spec.s3utils.metricshas a single consumer in the operator, so no other component changes cadence, and production keeps its 60 s.Considered and rejected: disabling the cron in CI. It would make the flake impossible, but that interleaving is what production does, and it is what surfaced the real accounting gaps in the first place.
Quotas.featureis byte-identical on development/2.14, 2.15 and 2.16, so this applies unchanged if we ever want it on the older lines.Issue: ZENKO-5338