Skip to content

Seed zero-value quota metric on bucket create / quota enable (9.3 backport) - #6238

Merged
bert-e merged 5 commits into
development/9.3from
improvement/CLDSRV-949/seed-empty-bucket-quota-metric-9.3
Jul 29, 2026
Merged

Seed zero-value quota metric on bucket create / quota enable (9.3 backport)#6238
bert-e merged 5 commits into
development/9.3from
improvement/CLDSRV-949/seed-empty-bucket-quota-metric-9.3

Conversation

@delthas

@delthas delthas commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Backport of CLDSRV-949 to development/9.3, prefixed with the arsenal dependency bump it requires.

Seeding a zero-value bucket metric document in __infostore at bucket creation (and quota-enable of a verifiably-empty bucket) makes bucket quota checks enforceable immediately instead of waiting up to 24h for count-items (ARTESCA-17063), and makes the Veeam SOSAPI capacity.xml report correct capacity from the first read on new repositories (RD-2109) — complementing the s3utils-side seeding backported in scality/s3utils#406.

Issue: CLDSRV-949

@bert-e

bert-e commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.

@scality scality deleted a comment from bert-e Jul 29, 2026
@bert-e

bert-e commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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.


async function freshStartCreateBucket(bucket, canonicalID, log, callback) {
if (callback) {
return freshStartCreateBucket(bucket, canonicalID, log).then(() => callback(null), callback);
function cleanUpBucket(bucketMD, canonicalID, log, callback) {
async function cleanUpBucket(bucketMD, canonicalID, log, callback) {
if (callback) {
return cleanUpBucket(bucketMD, canonicalID, log).then(() => callback(null), callback);
Comment thread lib/api/apiUtils/bucket/bucketCreation.js Fixed
Comment on lines +94 to +97
return bucketUpdateQuota(authInfo, request, log).then(
corsHeaders => callback(null, corsHeaders),
err => callback(err, err.code, err.additionalResHeaders),
);
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.45455% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.08%. Comparing base (2cfa00d) to head (81c3ce1).
⚠️ Report is 5 commits behind head on development/9.3.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
lib/api/bucketUpdateQuota.js 95.08% 3 Missing ⚠️
lib/api/apiUtils/bucket/bucketCreation.js 96.29% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
lib/api/apiUtils/bucket/bucketCreation.js 96.35% <96.29%> (+2.80%) ⬆️
lib/api/bucketUpdateQuota.js 96.10% <95.08%> (+0.02%) ⬆️
@@                 Coverage Diff                 @@
##           development/9.3    #6238      +/-   ##
===================================================
+ Coverage            85.02%   85.08%   +0.05%     
===================================================
  Files                  206      206              
  Lines                13383    13422      +39     
===================================================
+ Hits                 11379    11420      +41     
+ Misses                2004     2002       -2     
Flag Coverage Δ
file-ft-tests 68.33% <65.90%> (-0.07%) ⬇️
file-ft-tests-null-compat 68.84% <65.90%> (-0.07%) ⬇️
kmip-ft-tests 28.37% <27.27%> (+0.03%) ⬆️
mongo-v0-ft-tests 69.60% <65.90%> (-0.02%) ⬇️
mongo-v1-ft-tests 69.57% <65.90%> (-0.09%) ⬇️
multiple-backend 36.82% <27.27%> (+0.01%) ⬆️
s3c-ft-tests-v0 64.08% <65.90%> (-0.06%) ⬇️
s3c-ft-tests-v0-null-compat 64.14% <65.90%> (-0.06%) ⬇️
s3c-ft-tests-v1 64.05% <65.90%> (-0.06%) ⬇️
sur-tests 35.97% <65.90%> (-0.73%) ⬇️
sur-tests-inflights 37.83% <65.90%> (+0.12%) ⬆️
unit 71.00% <82.95%> (+0.30%) ⬆️
utapi-v2-tests 34.62% <27.27%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

delthas added 5 commits July 29, 2026 18:30
Isolates prettier reformatting of files that were already
prettier-dirty on development/9.4, so the functional change commits
that follow stay prettier-clean.

Issue: CLDSRV-949
(cherry picked from commit 74d98c0)
Seed a zero-value bucket metric document in __infostore when the
bucket is known to be empty, so bucket quota checks are enforceable
immediately instead of waiting up to 24h for the periodic count-items
job (ARTESCA-17063):

- on createBucket, the bucket is empty by definition, so seed it;
- on bucketUpdateQuota, seed only when the bucket is verifiably empty
  (a maxKeys:1 DelimiterVersions listing), never defaulting to zero
  for a bucket that may hold uncounted data.

Both paths are gated on config.isQuotaEnabled() and are best-effort:
a seeding failure is logged and never fails the request. The write
uses the new arsenal MetadataWrapper.initializeBucketCapacity
(idempotent $setOnInsert), keyed by the bucket's metastore
creationDate to match the enforcement lookup.

Issue: CLDSRV-949
(cherry picked from commit d25da9a)
Migrate bucketUpdateQuota and the bucket-creation seeding helpers
(seedBucketQuotaCapacity, freshStartCreateBucket, cleanUpBucket) to
async/await, using a callback trampoline so existing callers keep working.

Seed the zero metric before persisting the quota to close the fail-open
window, probe the MPU shadow bucket so a bucket with only in-progress
uploads is not seeded to zero, log seeding failures as non-fatal warnings,
and declare the promisified metadata helpers once at module scope.

Issue: CLDSRV-949
(cherry picked from commit 79c7731)
@delthas
delthas force-pushed the improvement/CLDSRV-949/seed-empty-bucket-quota-metric-9.3 branch from 568fdd6 to 81c3ce1 Compare July 29, 2026 16:33
@delthas
delthas requested review from a team, SylvainSenechal, benzekrimaha and francoisferrand and removed request for francoisferrand July 29, 2026 16:45
@delthas

delthas commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@scality scality deleted a comment from bert-e Jul 29, 2026
@bert-e

bert-e commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/9.3

  • ✔️ development/9.4

The following branches have NOT changed:

  • development/7.10
  • development/7.4
  • development/7.70
  • development/8.8
  • development/9.0
  • development/9.1
  • development/9.2

This pull request did not target the following hotfix branch(es) so they
were left untouched:

  • hotfix/7.10.2
  • hotfix/7.10.8
  • hotfix/7.10.27
  • hotfix/7.4.7
  • hotfix/7.70.45
  • hotfix/6.4.7
  • hotfix/7.70.21
  • hotfix/7.8.0
  • hotfix/9.2.24
  • hotfix/7.9.0
  • hotfix/7.7.0
  • hotfix/9.0.7
  • hotfix/7.4.4
  • hotfix/7.4.5
  • hotfix/7.10.15
  • hotfix/7.4.6
  • hotfix/7.4.1
  • hotfix/7.70.11
  • hotfix/7.10.3
  • hotfix/7.10.1
  • hotfix/7.10.28
  • hotfix/9.2.36
  • hotfix/7.4.2
  • hotfix/7.6.0
  • hotfix/7.4.3
  • hotfix/7.10.4
  • hotfix/7.10.49
  • hotfix/7.4.10
  • hotfix/8.8.45
  • hotfix/7.4.0
  • hotfix/9.0.32
  • hotfix/7.4.9
  • hotfix/7.2.0
  • hotfix/7.10.0
  • hotfix/7.10.30
  • hotfix/7.4.8
  • hotfix/7.70.51
  • hotfix/7.70.73

Please check the status of the associated issue CLDSRV-949.

Goodbye delthas.

The following options are set: approve

@bert-e
bert-e merged commit 81c3ce1 into development/9.3 Jul 29, 2026
37 checks passed
@bert-e
bert-e deleted the improvement/CLDSRV-949/seed-empty-bucket-quota-metric-9.3 branch July 29, 2026 22:29
@delthas

delthas commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/release

@delthas

delthas commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Release summary:

  • development/9.3: releasing 9.3.15
  • development/9.4: skipped — tag 9.4.0-preview.6 already exists (not bumped, or already released)

@eve-ci-cd
eve-ci-cd Bot deployed to zenko/improvement/ZENKO-5334/release-2.15.5@2.15 July 30, 2026 09:29 Active
@eve-ci-cd
eve-ci-cd Bot deployed to zenko/development/2.15 July 31, 2026 12:54 Active
@eve-ci-cd
eve-ci-cd Bot deployed to zenko/2.15.5 July 31, 2026 12:56 Active
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.

5 participants