Compare commits

...

2 Commits

Author SHA1 Message Date
Rahul Padigela 66bee25813 [wip] potential fix : set the prevPHDKey 2018-08-07 13:52:46 -07:00
Rahul Padigela 90bb0c7fbe [wip] add console logs to debug skip scan 2018-08-07 11:52:18 -07:00
3 changed files with 7 additions and 6 deletions

View File

@ -183,8 +183,10 @@ class Delimiter extends Extension {
this.CommonPrefixes.push(commonPrefix); this.CommonPrefixes.push(commonPrefix);
this.NextMarker = commonPrefix; this.NextMarker = commonPrefix;
++this.keys; ++this.keys;
console.log('key accepted');
return FILTER_ACCEPT; return FILTER_ACCEPT;
} }
console.log('key skipped')
return FILTER_SKIP; return FILTER_SKIP;
} }

View File

@ -22,6 +22,7 @@ class DelimiterMaster extends Delimiter {
*/ */
constructor(parameters) { constructor(parameters) {
super(parameters); super(parameters);
// non-PHD master version or a version whose master is a PHD version
this.prvPHDKey = undefined; this.prvPHDKey = undefined;
} }
@ -52,18 +53,15 @@ class DelimiterMaster extends Delimiter {
if (key !== this.prvPHDKey) { if (key !== this.prvPHDKey) {
return FILTER_ACCEPT; // trick repd to not increase its streak return FILTER_ACCEPT; // trick repd to not increase its streak
} }
} } else if (Version.isPHD(value)) {
if (Version.isPHD(value)) {
// master version is a PHD version: wait for the next version // master version is a PHD version: wait for the next version
this.prvPHDKey = key; this.prvPHDKey = key;
return FILTER_ACCEPT; // trick repd to not increase its streak return FILTER_ACCEPT; // trick repd to not increase its streak
} } else if (Version.isDeleteMarker(value)) {
if (Version.isDeleteMarker(value)) {
// version is a delete marker, ignore // version is a delete marker, ignore
return FILTER_ACCEPT; // trick repd to not increase its streak return FILTER_ACCEPT; // trick repd to not increase its streak
} }
// non-PHD master version or a version whose master is a PHD version this.prvPHDKey = key;
this.prvPHDKey = undefined;
if (this.delimiter) { if (this.delimiter) {
// check if the key has the delimiter // check if the key has the delimiter
const baseIndex = this.prefix ? this.prefix.length : 0; const baseIndex = this.prefix ? this.prefix.length : 0;

View File

@ -988,6 +988,7 @@ class MongoClientInterface {
// skipped // skipped
if (++streakLength === MAX_STREAK_LENGTH) { if (++streakLength === MAX_STREAK_LENGTH) {
// stop listing this key range // stop listing this key range
console.log('skip');
stream.destroy(); stream.destroy();
// update the new listing parameters here // update the new listing parameters here
// eslint-disable-next-line no-param-reassign // eslint-disable-next-line no-param-reassign