Commit f79b879
committed
fix: skip .lte() dedup check on Cosmos DB to prevent data loss
On Cosmos DB, wallTime has second precision (increment 0). After a
restart, the .lte() check at line 1064 compares the new event timestamp
against startAfter (from the last checkpoint). If events arrive within
the same wall-clock second as the last checkpoint, their timestamps
equal startAfter and .lte() returns true — silently dropping the events.
On standard MongoDB, clusterTime has monotonically increasing increments
within a second, so new events always have strictly greater timestamps.
The .lte() check is a client-side dedup guard only needed for the legacy
startAtOperationTime path. When resumeAfter is used (which includes
Cosmos DB), the server guarantees no duplicates.
The resume test still has an intermittent failure (~30% flake rate)
on Cosmos DB, which appears to be a separate timing issue in the test
utility getClientCheckpoint — not a production bug.1 parent 83be468 commit f79b879
2 files changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | | - | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1065 | 1080 | | |
1066 | 1081 | | |
1067 | 1082 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
219 | 226 | | |
220 | 227 | | |
221 | 228 | | |
| |||
0 commit comments