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 // Attempt to repair master
setTimeout(() => { setTimeout(() => {
this.asyncRepair(c, bucketName, objName, mst, log, this.asyncRepair(c, bucketName, objName, mst, log);
{ action: 'put' });
}, ASYNC_REPAIR_TIMEOUT); }, ASYNC_REPAIR_TIMEOUT);
return cb(null, `{"versionId": "${objVal.versionId}"}`); return cb(null, `{"versionId": "${objVal.versionId}"}`);
}); });
@ -701,22 +700,13 @@ class MongoClientInterface {
* Get the latest version and repair. The process is safe because * Get the latest version and repair. The process is safe because
* we never replace a non-PHD master * 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) => { this.getLatestVersion(c, objName, log, (err, value) => {
if (err) { if (err) {
log.error('async-repair: getting latest version', log.error('async-repair: getting latest version',
{ error: err.message }); { error: err.message });
return undefined; 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 => { this.repair(c, bucketName, objName, value, mst, log, err => {
if (err) { if (err) {
log.error('async-repair failed', { error: err.message }); log.error('async-repair failed', { error: err.message });