Compare commits
No commits in common. "82be4bd3e6779628d155033957599ce442ffc0d3" and "cc6ed165ddc180a3473f5c7ce9b71f2de6fa5198" have entirely different histories.
82be4bd3e6
...
cc6ed165dd
|
@ -112,6 +112,4 @@ module.exports = {
|
||||||
clientsRequireStringKey: { sproxyd: true, cdmi: true },
|
clientsRequireStringKey: { sproxyd: true, cdmi: true },
|
||||||
hasCopyPartBackends: { aws_s3: true, gcp: true },
|
hasCopyPartBackends: { aws_s3: true, gcp: true },
|
||||||
versioningNotImplBackends: { azure: true, gcp: true },
|
versioningNotImplBackends: { azure: true, gcp: true },
|
||||||
// user metadata applied on zenko-created objects
|
|
||||||
zenkoIDHeader: 'x-amz-meta-zenko-instance-id',
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -508,55 +508,6 @@ class MongoClientInterface {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* In this case the caller provides a versionId and a flag called usePHD.
|
|
||||||
* This function will save the versionId object as is and will set PHD on
|
|
||||||
* master. If a user performs any operation to find IsLatest, the PHD flag
|
|
||||||
* indicates to perform a search on the bucket to find the latest version.
|
|
||||||
* We rely on the natural ordering of versions for listings. We rely on
|
|
||||||
* internal MongoClientInterface operations for master version and repairs.
|
|
||||||
*/
|
|
||||||
putObjectVerCase4(c, bucketName, objName, objVal, params, log, cb) {
|
|
||||||
// eslint-disable-next-line
|
|
||||||
objVal.versionId = params.versionId;
|
|
||||||
const vObjName = formatVersionKey(objName, params.versionId);
|
|
||||||
const mst = generatePHDVersion(params.versionId);
|
|
||||||
return c.bulkWrite([{
|
|
||||||
updateOne: {
|
|
||||||
filter: {
|
|
||||||
_id: vObjName,
|
|
||||||
},
|
|
||||||
update: {
|
|
||||||
$set: {
|
|
||||||
_id: vObjName,
|
|
||||||
value: objVal,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
upsert: true,
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
updateOne: {
|
|
||||||
filter: {
|
|
||||||
_id: objName,
|
|
||||||
},
|
|
||||||
update: {
|
|
||||||
_id: objName, value: mst,
|
|
||||||
},
|
|
||||||
upsert: true,
|
|
||||||
},
|
|
||||||
}], {
|
|
||||||
ordered: 1,
|
|
||||||
}, err => {
|
|
||||||
if (err) {
|
|
||||||
log.error('putObjectVerCase4: error putting object version', {
|
|
||||||
error: err.message,
|
|
||||||
});
|
|
||||||
return cb(errors.InternalError);
|
|
||||||
}
|
|
||||||
return cb(null, `{"versionId": "${objVal.versionId}"}`);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Put object when versioning is not enabled
|
* Put object when versioning is not enabled
|
||||||
*/
|
*/
|
||||||
|
@ -588,12 +539,9 @@ class MongoClientInterface {
|
||||||
} else if (params && params.versionId === '') {
|
} else if (params && params.versionId === '') {
|
||||||
return this.putObjectVerCase2(c, bucketName, objName, objVal,
|
return this.putObjectVerCase2(c, bucketName, objName, objVal,
|
||||||
params, log, cb);
|
params, log, cb);
|
||||||
} else if (params && params.versionId && !params.usePHD) {
|
} else if (params && params.versionId) {
|
||||||
return this.putObjectVerCase3(c, bucketName, objName, objVal,
|
return this.putObjectVerCase3(c, bucketName, objName, objVal,
|
||||||
params, log, cb);
|
params, log, cb);
|
||||||
} else if (params && params.versionId && params.usePHD) {
|
|
||||||
return this.putObjectVerCase4(c, bucketName, objName, objVal,
|
|
||||||
params, log, cb);
|
|
||||||
}
|
}
|
||||||
return this.putObjectNoVer(c, bucketName, objName, objVal,
|
return this.putObjectNoVer(c, bucketName, objName, objVal,
|
||||||
params, log, cb);
|
params, log, cb);
|
||||||
|
|
Loading…
Reference in New Issue