Seed zero-value quota metric on bucket create / quota enable (9.3 backport) - #6238
Conversation
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
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 |
|
|
||
| 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); |
| return bucketUpdateQuota(authInfo, request, log).then( | ||
| corsHeaders => callback(null, corsHeaders), | ||
| err => callback(err, err.code, err.additionalResHeaders), | ||
| ); |
Codecov Report❌ Patch coverage is
Additional details and impacted files
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
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)
568fdd6 to
81c3ce1
Compare
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
This pull request did not target the following hotfix branch(es) so they
Please check the status of the associated issue CLDSRV-949. Goodbye delthas. The following options are set: approve |
|
/release |
|
Release summary:
|
Backport of CLDSRV-949 to
development/9.3, prefixed with the arsenal dependency bump it requires.Bump arsenal to 8.4.22+ lock regeneration — bringsMongoClientInterface.initializeBucketCapacity(ARSN-610, backported in Add initializeBucketCapacity to seed empty-bucket metrics (8.4 backport) Arsenal#2680) to the 8.4 line used by 9.3.development/9.4(PR Seed zero-value quota metric on bucket create / quota enable #6221): prettier pre-commit, the seed itself, and the async/await migration. All four touched files are identical between 9.3 and the 9.4 base, sogit merge-treetowarddevelopment/9.4shows conflicts only onpackage.json(arsenal pin / version) — the usual cascade resolution; the code merges as a no-op.Seeding a zero-value bucket metric document in
__infostoreat 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 SOSAPIcapacity.xmlreport correct capacity from the first read on new repositories (RD-2109) — complementing the s3utils-side seeding backported in scality/s3utils#406.Issue: CLDSRV-949