From 99d9fa04d6efd30aac782d9f050121b4b5d81b38 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Mon, 25 Nov 2024 18:43:05 +0100 Subject: [PATCH 1/3] Bump arsenal Issue: CLDSRV-563 --- package.json | 2 +- yarn.lock | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 173ab962b9..c66d33ea19 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "dependencies": { "@azure/storage-blob": "^12.12.0", "@hapi/joi": "^17.1.0", - "arsenal": "git+https://github.com/scality/arsenal#8.1.139", + "arsenal": "git+https://github.com/scality/arsenal#8.1.142", "async": "~2.5.0", "aws-sdk": "2.905.0", "bucketclient": "scality/bucketclient#8.1.9", diff --git a/yarn.lock b/yarn.lock index c216f49b5c..5af588008c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1040,9 +1040,9 @@ arraybuffer.slice@~0.0.7: optionalDependencies: ioctl "^2.0.2" -"arsenal@git+https://github.com/scality/arsenal#8.1.139": - version "8.1.139" - resolved "git+https://github.com/scality/arsenal#94c7038e7416afea35e03ca9a472cc813a654887" +"arsenal@git+https://github.com/scality/arsenal#8.1.142": + version "8.1.142" + resolved "git+https://github.com/scality/arsenal#7402f096c9839815db5f03cbc2f4117536f55c28" dependencies: "@azure/identity" "^3.1.1" "@azure/storage-blob" "^12.12.0" @@ -1078,7 +1078,7 @@ arraybuffer.slice@~0.0.7: sproxydclient "git+https://github.com/scality/sproxydclient#8.0.10" utf8 "3.0.0" uuid "^3.0.1" - werelogs scality/werelogs#8.1.4 + werelogs scality/werelogs#8.1.7 xml2js "~0.4.23" optionalDependencies: ioctl "^2.0.2" @@ -6270,16 +6270,16 @@ werelogs@scality/werelogs#8.1.0: dependencies: safe-json-stringify "1.0.3" -werelogs@scality/werelogs#8.1.4: - version "8.1.4" - resolved "https://codeload.github.com/scality/werelogs/tar.gz/d6bec11df034c88a12959791eb7dd60913eb5f47" +werelogs@scality/werelogs#8.1.5: + version "8.1.5" + resolved "https://codeload.github.com/scality/werelogs/tar.gz/4131abec824a336eeb68b531e6c91f2748a0644a" dependencies: fast-safe-stringify "^2.1.1" safe-json-stringify "^1.2.0" -werelogs@scality/werelogs#8.1.5: - version "8.1.5" - resolved "https://codeload.github.com/scality/werelogs/tar.gz/4131abec824a336eeb68b531e6c91f2748a0644a" +werelogs@scality/werelogs#8.1.7: + version "8.1.7" + resolved "https://codeload.github.com/scality/werelogs/tar.gz/ede35ff2a0a42904903a989c8372f99e4d308c30" dependencies: fast-safe-stringify "^2.1.1" safe-json-stringify "^1.2.0" From 4b016cf52a3bfe5c27fbf3fb09a3a6da829d5f8c Mon Sep 17 00:00:00 2001 From: williamlardier Date: Thu, 28 Nov 2024 12:16:19 +0100 Subject: [PATCH 2/3] Add quota support in Backbeat - Backbeat may send internal API requests that will evaluate quotas. This change fixes these scenarios, as they were trying to push finalizer hooks to an empty object. Issue: CLDSRV-586 --- lib/routes/routeBackbeat.js | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/routes/routeBackbeat.js b/lib/routes/routeBackbeat.js index 34a75cb5ff..15e53b10c9 100644 --- a/lib/routes/routeBackbeat.js +++ b/lib/routes/routeBackbeat.js @@ -1372,6 +1372,10 @@ function routeBackbeat(clientIP, request, response, log) { _normalizeBackbeatRequest(request); const requestContexts = prepareRequestContexts('objectReplicate', request); + // Ensure backbeat operations like expiration can properly use quotas + // eslint-disable-next-line no-param-reassign + request.finalizerHooks = []; + // proxy api requests to Backbeat API server if (request.resourceType === 'api') { if (!config.backbeat) { @@ -1518,16 +1522,24 @@ function routeBackbeat(clientIP, request, response, log) { return backbeatRoutes[request.method][request.resourceType] [request.query.operation](request, response, log, next); }], - err => { - if (err) { - return responseJSONBody(err, null, response, log); - } - log.debug('backbeat route response sent successfully', - { method: request.method, - bucketName: request.bucketName, - objectKey: request.objectKey }); - return undefined; - }); + err => async.forEachLimit( + // Finalizer hooks are used in a quota context and ensure consistent + // metrics in case of API errors. No operation required if the API + // completed successfully. + request.finalizerHooks, + 5, + (hook, done) => hook(err, done), + () => { + if (err) { + return responseJSONBody(err, null, response, log); + } + log.debug('backbeat route response sent successfully', + { method: request.method, + bucketName: request.bucketName, + objectKey: request.objectKey }); + return undefined; + }, + )); } From 2ac5a57d6fdf9d48043f012469202e4dae80fcf5 Mon Sep 17 00:00:00 2001 From: Francois Ferrand Date: Mon, 2 Dec 2024 18:43:16 +0100 Subject: [PATCH 3/3] Release cloudserver 8.8.38 Issue: CLDSRV-586 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c66d33ea19..82e47b2657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenko/cloudserver", - "version": "8.8.37", + "version": "8.8.38", "description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol", "main": "index.js", "engines": {