Commit f811bbb
committed
Fix Pusher bugs that omit sequences from checkpoint
I saw a failure of "Continuous Super-Fast Push" from a Windows build,
where the ending checkpoint was incorrect. Near the end of that test
it logged the active replicator checkpoint as:
`{"local":42,"localCompleted":[0,43,48,154]}`
which is clearly wrong as it shows some sequences unable to be sent.
The test log showed the Pusher holding off on a bunch of consecutive
sequences ("...Found 0 changes up to #43" etc) because it was already
sending a revision of that doc. This was logged for sequences 43 thru
48, which is very close to the missing sequences in the checkpoint
(43-47).
From inspection, I deduced the problem to be that the code block
with comment "This doc already has a revision being sent; wait till
that one is done" stores the current rev into `iDoc->second->nextRev`
to be processed later; but if that field already holds a revision
that one gets dropped on the floor: it's obsoleted by the current
one and doesn't need to be sent, but the checkpointer is never
notified.
Adding a call to `_checkpointer.completedSequence` in that case should
fix the problem. (Also, the existing call to
`_checkpointer.addPendingSequence` is unnecessary since the Changes-
Feed already marks sequences as pending.)
Unfortunately I'm unable to reproduce the test failure locally; it
probably only occurs because the test machine is slow.
PS: Later I found another bug with the same effect, this one involving
`_conflictsIMightRetry`. Added it to the fix.1 parent d893d42 commit f811bbb
3 files changed
Lines changed: 33 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
379 | 378 | | |
380 | 379 | | |
381 | 380 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| |||
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | | - | |
| 384 | + | |
384 | 385 | | |
| 386 | + | |
385 | 387 | | |
386 | 388 | | |
387 | 389 | | |
388 | | - | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
| |||
447 | 451 | | |
448 | 452 | | |
449 | 453 | | |
450 | | - | |
| 454 | + | |
| 455 | + | |
451 | 456 | | |
452 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
453 | 465 | | |
454 | 466 | | |
455 | 467 | | |
| |||
478 | 490 | | |
479 | 491 | | |
480 | 492 | | |
| 493 | + | |
481 | 494 | | |
482 | 495 | | |
483 | 496 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
| 440 | + | |
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
452 | 458 | | |
453 | 459 | | |
454 | 460 | | |
| |||
529 | 535 | | |
530 | 536 | | |
531 | 537 | | |
532 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
533 | 541 | | |
534 | 542 | | |
535 | 543 | | |
| |||
0 commit comments