Commit 17ef83e
committed
estuary-cdk: coordinate scheduled backfills for multi-cursor incremental states
Previously, connector-initiated backfills only coordinated the backfill
cutoff with the incremental cursor when state.inc was a single
ResourceState.Incremental. When state.inc was a dict (multiple
incremental tasks, e.g., REALTIME/LOOKBACK), the code would fall through
to the else branch and wipe the entire state, resetting the incremental
cursors to their initial values. This could cause the incremental cursors
to jump ahead when a connector-initiated backfill began.
If the backfill and incremental tasks always capture all fields,
skipping the incremental cursor ahead would at worst cause a slight delay
in when documents in the skipped portion were captured. However, if scheduled
backfills do not capture all fields (like with formula field refreshes),
fields for those skipped records could be permanently missed.
This commit updates the CDK to handle the case where there are multiple
incremental subtasks and single backfill task, and all incremental subtasks
are using datetime cursors. The minimum incremental cursor across all incremental
subtasks is now used as the cutoff for the single backfill task. The incremental
cursors are left untouched, meaning they do not skip ahead and prevents
the potential to skip data during a formula field refresh.1 parent 1f1d5e2 commit 17ef83e
1 file changed
+32
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
558 | 578 | | |
559 | 579 | | |
560 | 580 | | |
| |||
619 | 639 | | |
620 | 640 | | |
621 | 641 | | |
622 | | - | |
623 | | - | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
624 | 649 | | |
625 | | - | |
626 | | - | |
627 | 650 | | |
628 | | - | |
629 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
630 | 654 | | |
631 | | - | |
632 | | - | |
633 | | - | |
| 655 | + | |
| 656 | + | |
634 | 657 | | |
635 | 658 | | |
636 | 659 | | |
| |||
0 commit comments