Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
Fully Compatible
-
ALL
-
Sharding 2022-10-17
Description
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; |
}
|
}
|
Attachments
Issue Links
- is related to
-
SERVER-68361 LogTransactionOperationsForShardingHandler::commit misses transferring documents from prepared and non-prepared transactions changing a document's shard key value
-
- Closed
-