Skip to content

Pre-seed zero-value metrics for empty buckets#378

Draft
delthas wants to merge 1 commit intodevelopment/1.17from
improvement/S3UTILS-224/preseed-empty-bucket-metrics
Draft

Pre-seed zero-value metrics for empty buckets#378
delthas wants to merge 1 commit intodevelopment/1.17from
improvement/S3UTILS-224/preseed-empty-bucket-metrics

Conversation

@delthas
Copy link

@delthas delthas commented Mar 3, 2026

When all buckets are empty (0 objects), count-items produces no
bucket metric documents in __infostore. This is because
getObjectMDStats() only populates dataMetrics.bucket entries when
the MongoDB cursor yields objects — with 0 objects, the cursor
yields nothing, _processEntryData() is never called, and
dataMetrics.bucket remains {}. The flatMap in
updateStorageConsumptionMetrics() then produces zero documents,
and the atomic collection rename leaves __infostore with only
the countitems marker.

Downstream, Scuba's deep health check queries __infostore for any
metric document and crashes when it finds none, causing CloudServer
to mark the quota service as unavailable (ARTESCA-17063).

Pre-seed dataMetrics.bucket with zero-value entries for every known
bucket in CountManager.addWork(), using consolidateDataMetrics() to
create the canonical zero structure. When workers return results for
non-empty buckets, consolidation adds on top of these zeros. For
empty buckets, the zero entries survive through to
updateStorageConsumptionMetrics, ensuring every bucket gets a
document in __infostore.

Issue: S3UTILS-224

When all buckets are empty (0 objects), count-items produces no
bucket metric documents in __infostore. This is because
getObjectMDStats() only populates dataMetrics.bucket entries when
the MongoDB cursor yields objects — with 0 objects, the cursor
yields nothing, _processEntryData() is never called, and
dataMetrics.bucket remains {}. The flatMap in
updateStorageConsumptionMetrics() then produces zero documents,
and the atomic collection rename leaves __infostore with only
the countitems marker.

Downstream, Scuba's deep health check queries __infostore for any
metric document and crashes when it finds none, causing CloudServer
to mark the quota service as unavailable (ARTESCA-17063).

Pre-seed dataMetrics.bucket with zero-value entries for every known
bucket in CountManager.addWork(), using consolidateDataMetrics() to
create the canonical zero structure. When workers return results for
non-empty buckets, consolidation adds on top of these zeros. For
empty buckets, the zero entries survive through to
updateStorageConsumptionMetrics, ensuring every bucket gets a
document in __infostore.

Issue: S3UTILS-224
@bert-e
Copy link
Contributor

bert-e commented Mar 3, 2026

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.65%. Comparing base (378f68f) to head (c954e09).

Additional details and impacted files
@@                 Coverage Diff                  @@
##           development/1.17     #378      +/-   ##
====================================================
+ Coverage             43.62%   43.65%   +0.02%     
====================================================
  Files                    84       84              
  Lines                  5973     5976       +3     
  Branches               1255     1256       +1     
====================================================
+ Hits                   2606     2609       +3     
  Misses                 3321     3321              
  Partials                 46       46              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@delthas delthas requested a review from benzekrimaha March 3, 2026 17:19
@scality scality deleted a comment from bert-e Mar 3, 2026
@bert-e
Copy link
Contributor

bert-e commented Mar 3, 2026

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@delthas delthas changed the title S3UTILS-224: pre-seed zero-value metrics for empty buckets Pre-seed zero-value metrics for empty buckets Mar 4, 2026
@delthas delthas marked this pull request as draft March 9, 2026 08:42
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