Skip to content

Commit

Permalink
manually correct subsource status from starting to running (#31096)
Browse files Browse the repository at this point in the history
Subsources move from starting to running lazily once they see a record
flow through, even though they are online and healthy. This has been
repeatedly brought up as confusing by users. So now, if the parent
source is running, and the subsource is starting, we override its status
to running to relfect its healthy status.

<!--
Describe the contents of the PR briefly but completely.

If you write detailed commit messages, it is acceptable to copy/paste
them
here, or write "see commit messages for details." If there is only one
commit
in the PR, GitHub will have already added its commit message above.
-->

### Motivation

<!--
Which of the following best describes the motivation behind this PR?

  * This PR fixes a recognized bug.

    [Ensure issue is linked somewhere.]

  * This PR adds a known-desirable feature.

    [Ensure issue is linked somewhere.]

  * This PR fixes a previously unreported bug.

    [Describe the bug in detail, as if you were filing a bug report.]

  * This PR adds a feature that has not yet been specified.

[Write a brief specification for the feature, including justification
for its inclusion in Materialize, as if you were writing the original
     feature specification.]

   * This PR refactors existing code.

[Describe what was wrong with the existing code, if it is not obvious.]
-->

### Tips for reviewer

<!--
Leave some tips for your reviewer, like:

    * The diff is much smaller if viewed with whitespace hidden.
    * [Some function/module/file] deserves extra attention.
* [Some function/module/file] is pure code movement and only needs a
skim.

Delete this section if no tips.
-->

### Checklist

- [ ] This PR has adequate test coverage / QA involvement has been duly
considered. ([trigger-ci for additional test/nightly
runs](https://trigger-ci.dev.materialize.com/))
- [ ] This PR has an associated up-to-date [design
doc](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/README.md),
is a design doc
([template](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/design/00000000_template.md)),
or is sufficiently small to not require a design.
  <!-- Reference the design in the description. -->
- [ ] If this PR evolves [an existing `$T ⇔ Proto$T`
mapping](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/command-and-response-binary-encoding.md)
(possibly in a backwards-incompatible way), then it is tagged with a
`T-proto` label.
- [ ] If this PR will require changes to cloud orchestration or tests,
there is a companion cloud PR to account for those changes that is
tagged with the release-blocker label
([example](MaterializeInc/cloud#5021)).
<!-- Ask in #team-cloud on Slack if you need help preparing the cloud
PR. -->
- [ ] If this PR includes major [user-facing behavior
changes](https://github.com/MaterializeInc/materialize/blob/main/doc/developer/guide-changes.md#what-changes-require-a-release-note),
I have pinged the relevant PM to schedule a changelog post.
  • Loading branch information
sjwiesman authored Jan 21, 2025
1 parent 2e1c220 commit 7a8cb08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/catalog/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3243,6 +3243,17 @@ pub static MZ_SOURCE_STATUSES: LazyLock<BuiltinView> = LazyLock::new(|| BuiltinV
self_events.status <> 'ceased' AND
parent_events.status = 'stalled'
THEN parent_events.source_id
-- TODO: Remove this once subsources eagerly propogate their status
-- Subsources move from starting to running lazily once they see
-- a record flow through, even though they are online and healthy.
-- This has been repeatedly brought up as confusing by users.
-- So now, if the parent source is running, and the subsource is
-- starting, we override its status to running to relfect its healthy
-- status.
WHEN
self_events.status = 'starting' AND
parent_events.status = 'running'
THEN parent_events.source_id
ELSE self_events.source_id
END AS id_to_use
FROM
Expand Down

0 comments on commit 7a8cb08

Please sign in to comment.