Fix concurrent bootstrap output progress - #6849
Conversation
|
Claude claims that this re-introduces the same bug, just in enqueue_latest_snapshot, because that function does this: and that it should be more like this: It says:
Frankly, I don't understand the different kinds of bootstrapping well enough to judge whether it is right. |
The in-process server tests build their circuit from a Rust closure, so the pipeline config carries no program information and `compute_pipeline_diff` finds none to compare. `start_test_server_with_state` papered over that with a `with_program_ir` flag that injected one fixed empty IR, which only ever produces an empty diff. Take the IR itself, so a test can also inject IRs that differ across a restart and exercise the paths a recompiled program takes. `test_program_ir` builds one for the test circuit's single view, keyed on the view's persistent id. Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
`total_processed_input_records` promises that an output endpoint's output equals the circuit's output after that many input records. A concurrent bootstrap broke the promise for the endpoints whose relations it rebuilds: the pre-existing views stay live, so the primary circuit keeps stepping throughout the backfill, and `push_output` tagged each of those steps' empty batches with the pipeline's full record count. The endpoint stored it, claiming it had delivered output that the cutover had not yet re-emitted. A reader waiting on the counter to learn the sink is caught up -- `wait_for_output_progress` in the platform tests -- then read a transmitted count missing the whole re-emission. Withhold the progress figure from an endpoint the bootstrap still owes a re-emission, so the counter reaches the pipeline's count on the step that carries that output, not before. Fixes: feldera/cloud#1832 Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
Review caught the withheld progress figure coming back to life one branch over: `enqueue_latest_snapshot` replaced a `None` with the pipeline's current count, so a connector configured with `send_snapshot: true` on a relation the bootstrap rebuilds reported full progress while it was still owed the re-emission -- the same defect as on the delta path, reached through a different door. `None` on the batch queue means "leave the counter alone" everywhere else, and it now means that here too. The caller supplies the figure it wants reported, including the one this function used to synthesize: a snapshot reflects the last committed transaction, so an endpoint receiving one is up to date with the pipeline's count even mid-transaction, where the delta path has nothing to report. The regression test now runs both paths. Reported-by: Ben Pfaff <blp@feldera.com> Signed-off-by: Leonid Ryzhyk <ryzhyk@gmail.com>
2c185d6 to
7c7ba06
Compare
This was a good catch, thank you. |
|
The CI failure is unrelated; I will work on it separately. |
Fixes concurrent bootstrapping test failure.
Describe Manual Test Plan
Checklist
Breaking Changes?
Mark if you think the answer is yes for any of these components:
Describe Incompatible Changes