maintainer: add mode information in barrier logs (#4412)#5236
maintainer: add mode information in barrier logs (#4412)#5236ti-chi-bot wants to merge 1 commit into
Conversation
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
|
@hongyunyan This PR has conflicts, I have hold it. |
|
@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@ti-chi-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Code Review
This pull request aims to add replication mode information to barrier logs in the maintainer package. However, the changes introduce several unresolved git conflict markers across both maintainer/barrier.go and maintainer/barrier_event.go. These conflicts include references to unsupported flush-related fields and methods that do not exist on this branch, which will cause compilation failures. The feedback correctly identifies these critical issues and provides instructions on how to resolve the conflicts by discarding the unsupported flush logic while retaining the replication mode integration.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| <<<<<<< HEAD | ||
| mode int64 | ||
| ======= | ||
| flushEnabled bool | ||
| // mode identifies which replication pipeline this barrier belongs to | ||
| // (common.DefaultMode or common.RedoMode). Barrier state, resend messages, | ||
| // and logs must stay in the same mode. | ||
| mode int64 | ||
| >>>>>>> c1f39ed2e (maintainer: add mode information in barrier logs (#4412)) |
There was a problem hiding this comment.
There is an unresolved git conflict marker here. Since the flush logic is not supported on this branch and the corresponding fields are missing from BarrierEvent, we should resolve this conflict by keeping only the mode field and discarding flushEnabled.
// mode identifies which replication pipeline this barrier belongs to
// (common.DefaultMode or common.RedoMode). Barrier state, resend messages,
// and logs must stay in the same mode.
mode int64| <<<<<<< HEAD | ||
| event = NewBlockEvent(common.NewChangefeedIDFromPB(resp.ChangefeedID), common.NewDispatcherIDFromPB(span.ID), b.spanController, b.operatorController, blockState, b.splitTableEnabled) | ||
| ======= | ||
| event = NewBlockEvent(common.NewChangefeedIDFromPB(resp.ChangefeedID), common.NewDispatcherIDFromPB(span.ID), b.spanController, b.operatorController, blockState, b.splitTableEnabled, b.mode) | ||
| event.flushEnabled = b.flushEnabled | ||
| event.flushDispatcherAdvanced = !b.flushEnabled | ||
| >>>>>>> c1f39ed2e (maintainer: add mode information in barrier logs (#4412)) |
There was a problem hiding this comment.
Unresolved git conflict marker. Since flushEnabled and flushDispatcherAdvanced are not defined on BarrierEvent in this branch, we should resolve this conflict by only passing b.mode to NewBlockEvent and discarding the flush-related fields.
event = NewBlockEvent(common.NewChangefeedIDFromPB(resp.ChangefeedID), common.NewDispatcherIDFromPB(span.ID), b.spanController, b.operatorController, blockState, b.splitTableEnabled, b.mode)| <<<<<<< HEAD | ||
| event = NewBlockEvent(changefeedID, dispatcherID, b.spanController, b.operatorController, blockState, b.splitTableEnabled) | ||
| ======= | ||
| event = NewBlockEvent(changefeedID, dispatcherID, b.spanController, b.operatorController, blockState, b.splitTableEnabled, b.mode) | ||
| event.flushEnabled = b.flushEnabled | ||
| event.flushDispatcherAdvanced = !b.flushEnabled | ||
| >>>>>>> c1f39ed2e (maintainer: add mode information in barrier logs (#4412)) |
There was a problem hiding this comment.
| <<<<<<< HEAD | ||
| if be.selected.Load() { | ||
| log.Info("all dispatchers reported event done, remove event", | ||
| zap.String("changefeed", be.cfID.Name()), | ||
| zap.Uint64("committs", be.commitTs)) | ||
| // already selected a dispatcher to write, now all dispatchers reported the block event | ||
| b.blockedEvents.Delete(getEventKey(be.commitTs, be.isSyncPoint)) | ||
| } | ||
| ======= | ||
|
|
||
| log.Info("all dispatchers reported event done, remove event", | ||
| zap.String("changefeed", be.cfID.Name()), | ||
| zap.Uint64("committs", be.commitTs), | ||
| zap.Int64("mode", b.mode)) | ||
| b.blockedEvents.Delete(getEventKey(be.commitTs, be.isSyncPoint)) | ||
| >>>>>>> c1f39ed2e (maintainer: add mode information in barrier logs (#4412)) |
There was a problem hiding this comment.
Unresolved git conflict marker. Resolve this by keeping the original be.selected.Load() check while adding the mode field to the log message.
if be.selected.Load() {
log.Info("all dispatchers reported event done, remove event",
zap.String("changefeed", be.cfID.Name()),
zap.Uint64("committs", be.commitTs),
zap.Int64("mode", b.mode))
// already selected a dispatcher to write, now all dispatchers reported the block event
b.blockedEvents.Delete(getEventKey(be.commitTs, be.isSyncPoint))
}| <<<<<<< HEAD | ||
| ======= | ||
| // Phase 1 (Flush, storage split-table only): all influenced dispatchers flush pre-barrier DML first. | ||
| // This fence is required for storage sink when split-table is enabled: one table may span | ||
| // multiple dispatchers on different nodes, and pre-DDL DML must not overtake | ||
| // the writer's Action_Write. | ||
| if !be.flushDispatcherAdvanced { | ||
| msgs = be.sendFlushAction(mode) | ||
| if len(msgs) > 0 { | ||
| return msgs | ||
| } | ||
| // No influenced dispatcher needs Action_Flush (for example DB/ALL barriers with empty | ||
| // runtime influenced set like "DROP DATABASE IF EXISTS <db>" before any table exists). | ||
| // Advance flush phase immediately; otherwise the barrier can be stuck forever in phase 1. | ||
| be.flushDispatcherAdvanced = true | ||
| be.rangeChecker.Reset() | ||
| be.reportedDispatchers = make(map[common.DispatcherID]struct{}) | ||
| be.lastResendTime = time.Now().Add(-20 * time.Second) | ||
| log.Info("barrier flush phase auto advanced due to empty influenced dispatchers", | ||
| zap.String("changefeed", be.cfID.Name()), | ||
| zap.Uint64("commitTs", be.commitTs), | ||
| zap.Bool("isSyncPoint", be.isSyncPoint), | ||
| zap.String("barrierType", be.blockedDispatchers.InfluenceType.String()), | ||
| zap.Int64("mode", be.mode)) | ||
| } | ||
| >>>>>>> c1f39ed2e (maintainer: add mode information in barrier logs (#4412)) |
This is an automated cherry-pick of #4412
What problem does this PR solve?
Issue Number: close #4427
What is changed and how it works?
Check List
Tests
Questions
Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?
Release note