Repository navigation
Cherry pick #108441 to 26.3: Stop refreshable MV gracefully on Keeper without MULTI_READ on ATTACH/restore - #118300
Conversation
…/restore A coordinated refreshable materialized view (in a Replicated database) crashed the server when re-attached on a Keeper that lacks the MULTI_READ feature flag, e.g. after a Keeper downgrade. The constructor's up-front MULTI_READ / CREATE_IF_NOT_EXISTS check was gated behind the fresh-CREATE path (!attach && !is_restore_from_backup) inside the !replica_path_existed branch, so ATTACH / restore / existing-replica kept coordination enabled. The scheduling thread then threw NOT_IMPLEMENTED in readZnodesIfNeeded, which the doScheduling catch-all re-raised as a LOGICAL_ERROR, aborting the server (and crash-looping on restart). Move the feature-flag check before the znode-create block so it runs on every coordinated path. Fresh CREATE still rejects with NOT_IMPLEMENTED. On ATTACH / restore / existing-replica the view now enters a permanent, non-resumable "coordination unavailable" state: a new coordination.unavailable flag is set, the task is stopped, and the reason is recorded. doScheduling short-circuits to Disabled before touching Keeper, so readZnodesIfNeeded is never reached and the server stays up. coordination.coordinated is left true on purpose. Clearing it would turn an originally coordinated view into an uncoordinated one, and a later SYSTEM START VIEW or finalizeRestoreFromBackup would then resume it as a local refresh, which breaks the replicated target table of a non-APPEND view in a Replicated database. start() and finalizeRestoreFromBackup() now also check the unavailable flag and refuse to resume, so the view stays Disabled until the table is re-created on a Keeper that supports the required feature flags. Adds an integration test that creates a coordinated refreshable MV with MULTI_READ enabled, restarts on a Keeper with MULTI_READ disabled and asserts the server stays up with the view Disabled, and then asserts SYSTEM START VIEW does not resume an uncoordinated local refresh. Closes: #106737 Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ti-read test SYSTEM REFRESH VIEW is asynchronous: RefreshTask::run sets the state to Scheduling synchronously and the background scheduler only later reaches the coordination.unavailable branch and switches it back to Disabled. Reading system.view_refreshes right after the refresh request could therefore observe the transient Scheduling state and fail the assertion spuriously. Add SYSTEM WAIT VIEW after the refresh request (and after the downgrade restart, which schedules the same graceful-stop pass asynchronously) so the status read always waits for the scheduled pass. WAIT VIEW returns immediately once the view is Disabled, so it does not block on the coordination-unavailable view. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…htask-multiread-attach-106737
…tiread-attach-106737 Stop refreshable MV gracefully on Keeper without MULTI_READ on ATTACH/restore
|
The 26.3 cherry-pick conflicts, and I cannot resolve it in place: I have The conflict is a single hunk in I checked that the result is not a half no-op: all 40 added lines of #108441's One input for the decision: 26.3 has no CI hits of this signature, but that zero is uninformative, because 26.3 does not contain the carrier test ( So, for the 26.3 half: shall I open a resolution PR from my fork, as in #114814, or would you rather someone with push access resolve |
|
Dear @alexey-milovidov, @murphy-4o, @groeneai, this cherry-pick PR has not been updated for 3d0h1m29s. Please resolve the conflicts to backport #108441, or close this PR if the backport is no longer needed. This PR will be automatically closed after 7 days of inactivity. |
|
Three days on: one correction to what I offered, plus two measurements that decide this. I withdraw the fork-PR option I floated. On 2026-09-05 I offered to open a resolution PR from my fork, as in #114814. I should not have. #117883 was closed with: "You fix a cherry-pick by checking out the source branch, merging the target branch and pushing. A direct PR to the branch is not ok." I take that as ruling out a PR based on The 7-day timer discards the 26.3 backport, it does not renew the nag. In Waiting will not clear the conflict either. The resolution is one command. On
If you would rather merge a PR than push, say so and I will put the same resolved merge up against |
Resolve the cherry-pick conflict in `src/Storages/MaterializedView/RefreshTask.h`. The only conflicting hunk is a blank line inside `CoordinationState`: on master there was a blank line between `coordinated` and `read_only`, #108441 replaced it with the `unavailable` member and its comment, and 26.3 had removed that blank line. The conflict is resolved by keeping #108441's side, which is what the backport needs. The resulting tree differs from `backport/26.3/108441` by exactly #108441's own diff plus that blank line: 247 insertions and 8 deletions against the original 246 and 8. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
🕵 Resolved and pushed — the PR is now @groeneai your analysis was exactly right, and I pushed the resolution to What I did, which is the flow The one conflicting hunk was the blank line inside Two checks that the result is the intended one and not a half no-op:
I have not merged this PR — the backporting automation does that itself and then opens the actual backport PR against |
Original pull-request #108441
Do not merge this PR manually
This pull-request is a first step of an automated backporting.
It contains changes similar to calling
git cherry-picklocally.If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.
The check results does not matter at this step - you can safely ignore them.
Troubleshooting
If the conflicts were resolved in a wrong way
If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:
pr-cherrypicklabel from the PRYou also need to check the Original pull-request for
pr-backports-createdlabel, and delete if it's presented thereThe PR source
The PR is created in the CI job