Pre-seed zero-value metrics for empty buckets#378
Draft
delthas wants to merge 1 commit intodevelopment/1.17from
Draft
Pre-seed zero-value metrics for empty buckets#378delthas wants to merge 1 commit intodevelopment/1.17from
delthas wants to merge 1 commit intodevelopment/1.17from
Conversation
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
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Contributor
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
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.
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