Skip to content

[RFC] Snapshot-and-follow output connectors #5980

Closed

Description

@ryzhyk

This RFC proposes a feature that allows an output connector to dump the entire state of the view before streaming incremental updates. This is helpful in two situations

  1. Adding a new connector to a pipeline.

We currently have two ways to add a connector: HTTP connector can be added at runtime. Other types of connectors can be added by stopping and modifying the pipeline.

In both cases, the current behavior is to only stream new changes to the view to the connector. In some (most?) cases, the user may want to send the current state of the view to the data sink before streaming incremental changes.

1.1. Subscribing to view changes

This is an important special case. Currently we have to go through ugly hoops to subscribe to all view changes since the start of the pipeline in the Python API and the webconsole. This wouldn't be necessary if there was a way to stream the view snapshot first. Unfortunately, this RFC will not fully solve that problem as it will only work for materialized views.

  1. Resetting an existing connector.

It may also be useful to have an existing connector send the complete state snapshot. This is helpful, e.g., if a connector error or an issue with the data sink has caused data corruption. While this can be achieved by deleting and recreating the connector, a single reset API is more convenient.

This feature can only be supported for materialized views, since the pipeline maintains the snapshot of the view's state.

API Design

Non-HTTP output connectors

Add a new Boolean property called snapshot to connector config (on the same level as transport and format). The value is false by default for backward compatibility.

Alternatively we could add a mode property with possible values follow (current default) or snapshot_and_follow, and maybe snapshot if we're interested in snapshot-only connectors.

HTTP egress

Add a mode argument with the same possible values to the /egress endpoint. When set to snapshot_and_follow, the connector will stream the current content of the table before streaming changes.

Resetting a connector

Add a new API:

POST /pipeline/<pipeline_name>/views/<view_name>/connectors/<connector_name>/reset

If the connector is configured with snapshot or snapshot_and_follow mode, this will cause it to send the full snapshot again, as well as perform any other actions it does during normal initialization, such as truncate the output delta table.

Implementation plan

TBD

Gotchas

Sending a full snapshot can take a long time and stall the pipeline.

Activity

  1. added
    connectorsIssues related to the adapters/connectors crate
    high priorityTask should be tackled first, added in the current sprint if necessary
    user-reportedReported by a user or customer
    on Apr 1, 2026
  2. added theissue type on Apr 1, 2026
  3. lalithsuresh commented on Apr 2, 2026

    @lalithsuresh
    Contributor

    The API design makes sense. I think output mode should have follow and snapshot_and_follow. Not sure what a snapshot output mode does -- only writes out results once after the first step where it is used? That might have limited utility or be difficult to control for the user.

    Let's make sure the setting is also called mode on the input side and has similar types for symmetry: snapshot, snapshot_and_follow and follow. I guess there's also transaction_mode for some input connectors.

  4. ryzhyk commented on Apr 2, 2026

    @ryzhyk
    ContributorAuthor

    We can postpone snapshot until it it needed.

    Yes, the input config is also called mode in the Delta connector, but in that case it's a transport property. This new config will be a global property supported by all connectors.

  5. lalithsuresh commented on Apr 2, 2026

    @lalithsuresh
    Contributor

    We can then retire the transport property in the delta connector right?

  6. lalithsuresh commented on Apr 2, 2026

    @lalithsuresh
    Contributor

    Overall, I think this is a huge improvement. Allows users to build level-triggered systems as opposed to strictly edge-triggered.

  7. ryzhyk commented on Apr 2, 2026

    @ryzhyk
    ContributorAuthor

    We can then retire the transport property in the delta connector right?

    I don't think we can. It's in the input Delta connector and is connector-specific (i.e., we don't have a design to support it for all input connectors yet, even though it logically makes sense)

  8. ouatu-ro commented on Apr 5, 2026

    @ouatu-ro
    Contributor

    I just noticed in the docs that Delta and HTTP sinks don't support fault tolerance.
    There are a couple things I'd want to clarify:

    • reconnect semantics after failure/disconnect
    • a clear indicator in responses for snapshot vs updates
    • whether sequence numbers are only diagnostic or will support resumability
    • whether recovery after a gap is reset-and-resubscribe or will be resume-from-seq

    If someone asks for snapshot-and-subscribe, I assume they need continuity guarantees. So if at-least-once semantics are not provided, the natural client behavior is to reset and resubscribe whenever continuity is unclear.
    If that's the intended model, I think there are two separate things that would help a lot:

    • fail-closed option, so once continuity is lost, the client doesn't keep consuming a stream it can no longer treat as valid
    • some kind of circuit-break or backoff around reset, so repeated continuity failures don't turn into reset storms

    Otherwise recovery itself can become the failure mode, especially if the initial snapshot is large (which I see that is already a concern).

  9. gz commented on Apr 5, 2026

    @gz
    Contributor

    hi @ouatu-ro, delta and http should support fault tolerance e.g., see https://docs.feldera.com/pipelines/fault-tolerance#fault-tolerant-connectors

    (it is an enterprise only feature that we do not ship in the OSS version though, feel free to reach out to @lalithsuresh to learn more)

  10. ouatu-ro commented on Apr 5, 2026

    @ouatu-ro
    Contributor

    hi @ouatu-ro, delta and http should support fault tolerance e.g., see https://docs.feldera.com/pipelines/fault-tolerance#fault-tolerant-connectors

    (it is an enterprise only feature that we do not ship in the OSS version though, feel free to reach out to @lalithsuresh to learn more)

    Hello, sorry for the confusion. This feature is about output connectors: https://docs.feldera.com/connectors/sinks/http/
    The page you linked mentions that pipelines can include non-fault-tolerant output connectors.
    From the HTTP sink docs ("does not yet support fault tolerance") and from the code (crates/adapters/src/transport/http/output.rs, where is_fault_tolerant returns false), I inferred that HTTP egress itself is not fault-tolerant.

    If the docs or the code are outdated (or feature gated) and HTTP output does support fault tolerance, could you please confirm?

    PS: I reread that section. I am interested in contributing to snapshot_and_follow around HTTP. It sounds like you are saying that Enterprise pipelines can still get at-least-once behavior overall even though HTTP output itself is not fault-tolerant. If snapshot_and_follow is only meant to work well in that Enterprise-only setting, then it would be harder for me to contribute to directly, but my point about subscriber-visible continuity contracts would still stand either way.

  11. mythical-fred commented on Apr 6, 2026

    @mythical-fred

    The RFC mentions "sending a full snapshot can take a long time and stall the pipeline" as a gotcha, but does not address the consistency model during that window.

    Specifically: when a connector is in snapshot mode, what happens to incremental updates that arrive while the snapshot is being delivered?

    • Buffer them — memory pressure; for a large materialized view with high insert rate, this could be unbounded.
    • Drop them — silent data loss; consumer receives a complete snapshot followed by a gap.
    • Apply them to the snapshot in real-time — complex; requires the snapshot to be a point-in-time freeze, and only deltas from that exact checkpoint are streamed afterward.

    Option 3 is the only correct one, but it needs to be explicit: the snapshot must correspond to a specific pipeline step/checkpoint boundary, and incremental delivery must resume from exactly that point. If that is the intended design, the API should expose the snapshot timestamp or step number so consumers can verify continuity.

    This is also relevant to ouatu-ro's question about sequence number resumability — a sequence number only enables recovery if the snapshot is taken at a well-defined step boundary.

  12. ouatu-ro commented on Apr 6, 2026

    @ouatu-ro
    Contributor
    • Buffer them — memory pressure; for a large materialized view with high insert rate, this could be unbounded.

    Apply them to the snapshot in real-time

    Not sure if redundant from my part, but: buffering would be required either way because of transport. If not handled explicitly, it will occur implicitly in the OS/network stack (in addition to backpressure).

    If you apply updates to the snapshot while it is already being transmitted, you get a "fuzzy snapshot" that corresponds to no well-defined cutover boundary (neither the start nor the end state). So that option is only sound before transport commitment. At that point, post-cutover updates must live somewhere until snapshot delivery completes.

  13. gz commented on Apr 6, 2026

    @gz
    Contributor

    cc @blp who was working on this feature

  14. ryzhyk commented on Apr 6, 2026

    @ryzhyk
    ContributorAuthor

    @ouatu-ro , FYI, @mythical-fred is an AI and is still learning :) He clearly doesn't know that buffered outputs, especially large ones, are mostly kept in storage, not in-memory. In addition, there is a backpressure mechanism that will stall the pipeline when there's >1M outputs buffered by an output connector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

connectorsIssues related to the adapters/connectors cratehigh priorityTask should be tackled first, added in the current sprint if necessaryuser-reportedReported by a user or customer

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions