← 输入框|github.com|刷新
Skip to content

[types,connectors] Add StepInputs::Paused for a paused multihost pipeline. - #7974

Merged
blp merged 1 commit into
mainfrom
step-inputs-paused
Nov 13, 2026
Merged

blp merged 1 commit into
mainfrom
step-inputs-paused

Conversation

@blp

@blp blp commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

A paused multihost pipeline cannot process forced HTTP input, because its coordinator does not start steps while the pipeline is paused (feldera/cloud#2208).

This PR lets a coordinator request a step with StepInputs::Paused:

Part Change
StepInputs::Paused (feldera-types) New variant. A step with it polls only HTTP input endpoints, which accept input while paused only with force=true.
StepSelection::polls() (crates/connectors/src/controller.rs) Handles the new variant. Like CheckpointBarriers, such a step records no StepFeed.
CoordinationCapabilities::accepts_paused_step_inputs New capability, because an older pipeline cannot parse a step request with StepInputs::Paused. The coordinator sends it only if every host reports it.
multihost_paused_step_polls_only_http_input New test: a Paused step takes HTTP input and leaves the other connector's input buffered. It fails if Paused polls every endpoint.

Nothing changes for a single-host pipeline. The coordinator side is feldera/cloud#2209.

This was split out of #7941, which changes single-host pause behavior and waits for a design decision. #7941 is now stacked on this PR.

Tests: controller, server and HTTP suites (162) pass; clippy is clean.

@blp blp added connectors Issues related to the adapters/connectors crate multihost Related to multihost or distributed pipelines labels Nov 13, 2026
@blp blp self-assigned this Nov 13, 2026
@blp
blp requested a review from mihaibudiu November 13, 2026 16:33
@mythical-fred-oss

Copy link
Copy Markdown
Contributor

LGTM. The change is small and correct. A locally paused controller still runs coordinator steps, because pause only drives backpressure, and a paused HTTP reader still flushes on Queue. Ad-hoc INSERT is correctly excluded because it has no force. The capability's #[serde(default)] keeps older hosts compatible.

What I ran

Check Result
cargo test -p static-connectors --test connector_suites -- controller:: 122 passed
cargo test -p feldera-types passed
New test ×40 0 failures, no flakiness seen
Mutation: Paused => true New test fails ✅
pre-commit run --files <changed> passed

Missing (medium): the test does not cover the paused case it is named after. multihost_paused_step_polls_only_http_input never calls controller.pause(), and send_ingress uses force=false. So nothing checks the production path: a paused host, an HTTP reader paused by backpressure, a force=true request, then a Paused step. I wrote this test and it passes locally. Consider adding it:

diff
/// Like `multihost_paused_step_polls_only_http_input`, but with the pipeline
/// actually paused and the HTTP input forced, as in production.
#[engine_test]
pub fn multihost_paused_step_takes_forced_http_input(engine: &dyn PipelineTestEngine) {
    use feldera_types::coordination::{StepAction, StepInputs, StepRequest};
    init_test_logger();
    let config: PipelineConfig = serde_json::from_value(json!({
        "name": "test", "workers": 4, "clock_resolution_usecs": null,
        "multihost": { "hosts": 1 },
    })).unwrap();
    let controller = engine
        .controller(&identity(&[None]), &config, Box::new(|e, _| panic!("error: {e}")))
        .unwrap();
    controller.pause();
    let http = HttpInputEndpoint::new(HttpInputConfig { name: "http".into() });
    controller
        .add_input_endpoint("http", http_input_config("http"), Box::new(http.clone()), None)
        .unwrap();
    TOKIO.block_on(async {
        let (request, mut payload) = actix_web::test::TestRequest::default()
            .set_payload(r#"{"id": 1, "b": true, "i": 1, "s": "x"}"#)
            .to_http_parts();
        let payload = <actix_web::web::Payload as actix_web::FromRequest>::from_request(
            &request, &mut payload).await.unwrap();
        http.complete_request(payload, true, None).await.unwrap();
    });
    let step = controller.step_watcher().borrow().step;
    controller.set_coordination_request(StepRequest::new(step, StepAction::Step, StepInputs::Paused));
    wait(|| controller.step_watcher().borrow().step > step, 10_000)
        .expect("the coordinator's step never ran");
    let status = controller.status();
    wait(|| status.num_total_processed_records() == 1, 10_000)
        .expect("the paused step did not take the forced HTTP input");
    controller.stop().unwrap();
}

No feldera-pr-checks gate fails. Docs are not needed: StepInputs and the capability are internal to the coordinator and do not appear in openapi.json.

@blp
blp force-pushed the step-inputs-paused branch from 4805223 to 3aafb87 Compare November 13, 2026 17:06
@blp

blp commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Thanks. Fixed in 3aafb87, squashed into the single commit. I did not add a second, almost identical test. I changed multihost_paused_step_polls_only_http_input instead:

Before After
controller.start() controller.pause()
send_ingress(&http, 10..12), with force=false send_ingress_with_force(&http, 10..12, true) (a new helper; send_ingress calls it with false)

The test still checks that the other connector's input stays buffered. It fails with Paused => true and also with Paused => false. It passed 10 of 10 runs. The controller, server and HTTP suites (162 tests) pass, and clippy and fmt are clean. #7941, which is stacked on this PR, also passes with the change.

-- Claude Code, replying at @blp's request.

/// A pipeline without this capability cannot parse a step request with
/// that value.
#[serde(default)]
pub paused_step_inputs: bool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be called accepts_paused_step_inputs

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 573faaf: the field is now accepts_paused_step_inputs. No release has the old name yet, so the wire name changes safely.

-- Claude Code, replying at @blp's request.


/// The pipeline is paused. Consider input arriving only on HTTP input
/// endpoints to trigger a step, and for executing a step, use input only
/// from them. While the pipeline is paused, they accept input only from

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider -> allow?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 573faaf: "Allow only input arriving on HTTP input endpoints to trigger a step". The other variants still say "Consider".

-- Claude Code, replying at @blp's request.

@blp
blp force-pushed the step-inputs-paused branch from 3aafb87 to 7cdd61a Compare November 13, 2026 18:48
…peline.

A paused multihost pipeline cannot process forced HTTP input, because its
coordinator does not start steps while the pipeline is paused.

Now a coordinator can request a step with `StepInputs::Paused`.  Such a
step polls only HTTP input endpoints, which accept input while paused only
from requests with `force=true`, and records no `StepFeed`, as for
`CheckpointBarriers`.  The coordinator change is feldera/cloud#2209, for
feldera/cloud#2208.

A pipeline reports the new `accepts_paused_step_inputs` capability,
because an older pipeline cannot parse a step request with
`StepInputs::Paused`.

This changes nothing for a single-host pipeline.

Signed-off-by: Ben Pfaff <blp@feldera.com>
@blp
blp force-pushed the step-inputs-paused branch from 7cdd61a to 573faaf Compare November 13, 2026 18:49
@blp
blp enabled auto-merge November 13, 2026 18:49
@blp
blp disabled auto-merge November 13, 2026 22:38
@blp
blp added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit f254c8b Nov 13, 2026
1 of 2 checks passed
@blp
blp deleted the step-inputs-paused branch November 13, 2026 23:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

connectors Issues related to the adapters/connectors crate multihost Related to multihost or distributed pipelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants