Skip to content

Commit 265a27e

Browse files
committed
Sort group results.
1 parent 3c3588c commit 265a27e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/module-mongodb-storage/src/storage/implementation/MongoChecksums.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,10 @@ export class MongoChecksums {
247247
},
248248
last_op: { $max: '$_id.o' }
249249
}
250-
}
250+
},
251+
// Sort the aggregated results (100 max, so should be fast).
252+
// This is important to identify which buckets we have partial data for.
253+
{ $sort: { _id: 1 } }
251254
],
252255
{ session: undefined, readConcern: 'snapshot', maxTimeMS: lib_mongo.MONGO_CHECKSUM_TIMEOUT_MS }
253256
)

0 commit comments

Comments
 (0)