fix(frontend): sync global sysvar commits across CNs - #27534
Closed
ck89119 wants to merge 18 commits into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #26793
What this PR does / why we need it:
A successful
SET GLOBALcatalog commit could be followed by a new session on another CN reading an older catalog snapshot. Proxy connection reuse also reset backend sessions only when they entered the cache, so a global-variable update committed while a backend was idle could still be missed at handoff.This PR:
SyncCommitquery command;SyncCommitACK; catalog refreshes retry whenever either the epoch or local mutation generation changes, and stamp a per-variable publication floor with the applied commit TS;SET GLOBALcache values with the same commit TS used by the fence; if this CN has already applied a newer remote fence, the delayed setter creates and closes a background executor and reloads catalog under a stable epoch instead of directly publishing its older value;PopContexthandoff, after the previous generation was cleaned at Push, and discards the backend on refresh failure or cancellation;SyncCommit(after main assigned v27/v28), preflights every target CN withGetProtocolVersion, and sends no Sync RPC if any target still has the legacy fatal-on-timeout handler;No new protobuf field, HAKeeper state machine, Proxy routing lease, or durable outbox is introduced.
Validation
go testand full-raceruns passed for./pkg/txn/client,./pkg/queryservice/client,./pkg/cnservice,./pkg/frontend, and./pkg/proxy.-race -count=100.go list,go build,go vet, andmake buildpassed.ExeSqlInBgSesimplementation and verifies executor creation, use, and closure; membership tests require Working/Unknown/Draining/Drained/TimeoutState stores with query addresses to be fenced.