From 6ca6cca47514002923e05e1ff90bc1861359f9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20DONNART?= Date: Fri, 19 Jun 2026 18:11:39 +0200 Subject: [PATCH 1/2] Adopt timestamp-ordered microVersionId in CRR resync tool Bump arsenal to pick up the new microVersionId format (ts + seq + repGroupId), required by cascaded CRR for loop detection and stale event handling. The resync tool bypasses CloudServer's S3 API, so it generates a random per-instance repGroupId and passes it to updateMicroVersionId() to avoid colliding with concurrent writers. Issue: S3UTILS-234 --- CRR/ReplicationStatusUpdater.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CRR/ReplicationStatusUpdater.js b/CRR/ReplicationStatusUpdater.js index c1a0495f..6216ff40 100644 --- a/CRR/ReplicationStatusUpdater.js +++ b/CRR/ReplicationStatusUpdater.js @@ -1,3 +1,4 @@ +const crypto = require('crypto'); const { doWhilst, eachSeries, eachLimit, waterfall, } = require('async'); @@ -72,6 +73,14 @@ class ReplicationStatusUpdater { this.forceUsingConfiguration = forceUsingConfiguration; this.log = log; + // Random replicationGroupId (7 chars) and instanceId (6 chars) for + // microVersionId generation: this tool bypasses CloudServer's + // configured values, so per-instance random tokens prevent + // collisions with concurrent writers. Sizes match LENGTH_RG and + // LENGTH_ID in arsenal's VersionID module. + this.replicationGroupId = crypto.randomBytes(4).toString('hex').slice(0, 7); + this.instanceId = crypto.randomBytes(3).toString('hex').slice(0, 6); + this._setupClients(); this.logProgressInterval = setInterval(this._logProgress.bind(this), LOG_PROGRESS_INTERVAL_MS); @@ -193,7 +202,7 @@ class ReplicationStatusUpdater { return process.nextTick(next); } - objMD.updateMicroVersionId(); + objMD.updateMicroVersionId(this.instanceId, this.replicationGroupId); const md = objMD.getSerialized(); return this.cloudserverclient.putMetadata({ Bucket: bucket, From 128b8c725cced2373ff3ba1eefb5fff3d57bb8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20DONNART?= Date: Fri, 26 Jun 2026 18:29:26 +0200 Subject: [PATCH 2/2] Bump package.json to 1.19.0 Issue: S3UTILS-234 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3f63fa4..ba942c8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "s3utils", - "version": "1.18.0", + "version": "1.19.0", "engines": { "node": ">= 22" },