Repository navigation
Conversation
|
LGTM.
The endpoint status is registered before the output thread spawns, so the startup read always finds it. The suite wait on |
…oint An output endpoint with an output buffer could move its processed counts (total_processed_input_records, total_processed_steps) back to an old value, down to 0. Completion tokens and the completion status of the pipeline use these counts, so a token could wait until the next commit. The output thread keeps, in its buffer, the counts that the endpoint reaches when the buffer is flushed. The buffer got these counts only from the entries that went through it. In two cases the endpoint status had newer counts than the buffer: - Output that goes to the connector without the buffer (an initial snapshot) stores its counts in the endpoint status only. - The status of an endpoint that is level with the circuit starts with the committed counts, and its buffer started at 0. When the next entry was an empty step of an open transaction, which has no counts, the thread reported the empty buffer as flushed with the old counts of the buffer. Record the counts in the buffer in both cases: when output goes to the connector directly, and when the output thread starts. Two suite cases add a buffered endpoint after a committed step, with and without a snapshot, run a step of an open transaction, and check that the counts of the endpoint did not change. Fixes: #8028 Signed-off-by: Xavier Bestel <xavier.bestel@feldera.com>
|
LGTM. The fix is correct. Only the output thread writes the endpoint's processed counts, and every count it receives is no older than the last one. So setting the buffer's counts when the thread starts and on the unbuffered path cannot move the counts backwards.
Missing (medium): uncovered cases. I traced these by hand and they look correct, but no test covers them:
All feldera-pr-checks gates pass. SQL type coverage does not apply because no format or encoding code changed. The changelog is updated, and there is no breaking change. |
swanandx
left a comment
There was a problem hiding this comment.
LGTM. I ran the controller tests and they pass. With the two record_unbuffered calls removed, both new suite cases fail with (0, 0).
Three cases that the review traced by hand now have tests: - A buffered endpoint that starts again from a checkpoint, then a step of an open transaction during the replay: the counts of the endpoint do not move back. - A paused buffered endpoint that owes its snapshot: after the snapshot is delivered, a step of an open transaction does not move the counts back. - A snapshot that goes out with no counts, because the endpoint owes a new emission after a bootstrap: the counts stay as they are until that emission. The first two fail without the calls that keep the buffer level with the endpoint status. Signed-off-by: Xavier Bestel <xavier.bestel@feldera.com>
|
Status of the review points, as of e09c330:
The five buffered cases pass 5 of 5 runs. |
Linked Issue
Fixes #8028. Found during the review of #8018 (related to #8014).
What changes
An output endpoint with
enable_output_buffercould move its processed counts (total_processed_input_records,total_processed_steps) back to an old value, down to 0. Completion tokens and the completion status of the pipeline use these counts, so a token could wait until the next commit.The output thread keeps in its
OutputBufferthe counts that the endpoint reaches when the buffer is flushed. The buffer got these counts only from entries that went through it. When the next entry was an empty step of an open transaction (no counts), the thread reported the empty buffer as flushed, with the counts of the buffer.The second case is not in the issue. It has the same cause and the same effect, and the first suite case led to it.
Describe Manual Test Plan
buffered_output_keeps_snapshot_counts_during_transaction: one committed step, add a buffered endpoint with a snapshot, then a step of an open transactionbuffered_output_keeps_initial_counts_during_transaction: the same with no snapshot(0, 0), expected(1, 3)and(1, 2)OutputBuffer: counts recorded without the buffer stay after an empty entry with no countsdbsp_connectorsandstatic-connectorsChecklist
Breaking Changes?
None.