Compare commits

...

2 Commits

Author SHA1 Message Date
philipyoo 54e1b344db revert 2019-06-07 11:57:44 -07:00
philipyoo 48cfe62034 change ver case 4 2019-06-07 11:57:32 -07:00
1 changed files with 2 additions and 12 deletions

View File

@ -553,8 +553,7 @@ class MongoClientInterface {
}
// Attempt to repair master
setTimeout(() => {
this.asyncRepair(c, bucketName, objName, mst, log,
{ action: 'put' });
this.asyncRepair(c, bucketName, objName, mst, log);
}, ASYNC_REPAIR_TIMEOUT);
return cb(null, `{"versionId": "${objVal.versionId}"}`);
});
@ -701,22 +700,13 @@ class MongoClientInterface {
* Get the latest version and repair. The process is safe because
* we never replace a non-PHD master
*/
asyncRepair(c, bucketName, objName, mst, log, options) {
asyncRepair(c, bucketName, objName, mst, log) {
this.getLatestVersion(c, objName, log, (err, value) => {
if (err) {
log.error('async-repair: getting latest version',
{ error: err.message });
return undefined;
}
// if a PHD was created on put, compare latest version with
// the version id saved on PHD
if (options && options.action === 'put') {
// if version id does not match, PHD has been replaced and
// we should ignore this repair
if (value.versionId !== mst.versionId) {
return undefined;
}
}
this.repair(c, bucketName, objName, value, mst, log, err => {
if (err) {
log.error('async-repair failed', { error: err.message });