-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Testing Infrastructure
-
Fully Compatible
-
ALL
-
Sharding 2022-10-17
PeekableCursor#hasNext() does not consider the state of this.stashedDoc. This causes the last document returned by the PeekableCursor to be considered missing by DataConsistencyChecker#getDiff() despite it potentially having the same _id as the cursor from the other cursor.
class PeekableCursor { constructor(cursor) { this.cursor = cursor; this.stashedDoc = undefined; } hasNext() { return this.cursor.hasNext(); } peekNext() { if (this.stashedDoc === undefined) { this.stashedDoc = this.cursor.next(); } return this.stashedDoc; } next() { const result = (this.stashedDoc === undefined) ? this.cursor.next() : this.stashedDoc; this.stashedDoc = undefined; return result; } }
- is related to
-
SERVER-68361 LogTransactionOperationsForShardingHandler::commit misses transferring documents from prepared and non-prepared transactions changing a document's shard key value
- Closed