Skip to content

Commit adc45fd

Browse files
author
Kerkesni
committed
update master when putting metadata for CRR
When using the MongoDB backend, we have to pass repairMaster to make it update the master with the latest version, otherwise the master is only updated when the version being put has the same versionId as the master. Issue: CLDSRV-618
1 parent a741b34 commit adc45fd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lib/routes/routeBackbeat.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,13 @@ function putMetadata(request, response, bucketInfo, objMd, log, callback) {
619619
// To prevent this, the versionId field is only included in options when it is defined.
620620
if (versionId !== undefined) {
621621
options.versionId = versionId;
622+
// In the MongoDB metadata backend, setting the versionId option leads to the creation
623+
// or update of the version object, the master object is only updated if its versionId
624+
// is the same as the version. This can lead to inconsistencies when replicating objects
625+
// in the wrong order (can happen when retrying after failures), where the master object
626+
// might point to a non current version. To prevent this, we need to set repairMaster to
627+
// true which will update the master to the latest version available at the time of the put.
628+
options.repairMaster = true;
622629
}
623630

624631
// If the new null keys logic (S3C-7352) is not supported (compatibility mode), 'isNull' remains undefined.

0 commit comments

Comments
 (0)