Compare commits

...

3 Commits

Author SHA1 Message Date
philipyoo aa95b72aa3 use setOnInsert and min 2019-06-06 16:54:46 -07:00
philipyoo 2a1a25a3f3 test max field 2019-06-06 11:38:10 -07:00
philipyoo 97fa83fc62 add logs 2019-06-06 10:12:38 -07:00
1 changed files with 11 additions and 1 deletions

View File

@ -538,7 +538,13 @@ class MongoClientInterface {
_id: objName,
},
update: {
_id: objName, value: mst,
$min: {
'value.versionId': params.versionId,
},
$setOnInsert: {
'_id': objName,
'value.isPHD': true,
},
},
upsert: true,
},
@ -711,9 +717,13 @@ class MongoClientInterface {
// if a PHD was created on put, compare latest version with
// the version id saved on PHD
if (options && options.action === 'put') {
console.log('\n==== IN ASYNC REPAIR ====')
console.log('RECEIVED ACTION PUT')
console.log(`${value.versionId} !== ${mst.versionId}`)
// if version id does not match, PHD has been replaced and
// we should ignore this repair
if (value.versionId !== mst.versionId) {
console.log('VERSION ID DOES NOT MATCH, IGNORE THIS REPAIR')
return undefined;
}
}