Skip to content

connectors: fix producer.send() failure lets a later batch supersede the skipped state save #3898

Description

@mlevkov

Split out of the #3795 review at hubcio's suggestion, so it is not lost when that PR merges.

The shape

source_forwarding_loop persists a source's ConnectorState only on the success branch of the Iggy send. When producer.send() fails, the loop logs, skips the save, and continues to the next batch.

Sources advance their cursor at poll time and snapshot it into every batch (tracking_offsets in postgres_source, same shape in the others). So the next batch that does land persists a cursor that already covers the batch whose send failed, and a restart resumes past it.

That is the same supersession #3795 fixes for the shutdown-drop path with a per-instance dropped latch. The latch does not close this one: it is armed only by a drop, not by a send failure.

Why it is filed separately rather than fixed there

Two differences from the shutdown case, both of which argue for treating it on its own:

Whether the fix is the same latch armed from this path, a retry, or something that surfaces the gap rather than hiding it, is a design question worth its own discussion.

Happy to take it once the direction is settled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions