Skip to content

eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836)#5233

Open
ti-chi-bot wants to merge 1 commit into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-4836-to-release-8.5
Open

eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836)#5233
ti-chi-bot wants to merge 1 commit into
pingcap:release-8.5from
ti-chi-bot:cherry-pick-4836-to-release-8.5

Conversation

@ti-chi-bot

Copy link
Copy Markdown
Member

This is an automated cherry-pick of #4836

What problem does this PR solve?

Issue Number: close #4843

This PR is helpful to remove the call to the GetTimezone method, which print a log each time on the dispatcher request, such as add dispatcher

What is changed and how it works?

  • event broker set the tz from the server config
  • remove the timezone from the dispatcher request
  • set the filter to the changefeed level on the event broker side.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Questions

Will it cause performance regression or break compatibility?
Do you need to update user documentation, design documentation or monitoring documentation?

Release note

`None`

Summary by CodeRabbit

  • Refactor

    • Restructured how changefeed filters and timezone are managed and shared across the event service to improve consistency and reuse.
  • Tests

    • Updated tests to exercise the new shared filter and changefeed status initialization behavior.

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot ti-chi-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR. labels Jun 8, 2026
@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

This cherry pick PR is for a release branch and has not yet been approved by triage owners.
Adding the do-not-merge/cherry-pick-not-approved label.

To merge this cherry pick:

  1. It must be LGTMed and approved by the reviewers firstly.
  2. For pull requests to TiDB-x branches, it must have no failed tests.
  3. AFTER it has lgtm and approved labels, please wait for the cherry-pick merging approval from triage owners.
Details

Instructions 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.

@ti-chi-bot

Copy link
Copy Markdown
Member Author

@3AceShowHand This PR has conflicts, I have hold it.
Please resolve them or ask others to resolve them, then comment /unhold to remove the hold label.

@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign flowbehappy for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot

ti-chi-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

@ti-chi-bot: ## If you want to know how to resolve it, please read the guide in TiDB Dev Guide.

Details

Instructions 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.

@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e272ed03-a447-4b8b-adb7-b8c984daaaa9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ti-chi-bot ti-chi-bot Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the event service to use server-level timezone configurations and introduces a shared filter storage to optimize filter handling. However, the PR currently contains numerous unresolved merge conflicts across multiple test and source files, including git conflict markers. Additionally, there are critical compilation errors, such as the 'changefeedStatus' struct missing several fields and methods referenced by the new tests, and a signature mismatch where 'newChangefeedStatus' is called with two arguments but only defined with one. These issues must be resolved before the code can be compiled and merged.

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.


type changefeedStatus struct {
changefeedID common.ChangeFeedID
filter filter.Filter

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The changefeedStatus struct is missing several fields and methods that are referenced by the newly added tests and code in event_broker.go and event_broker_test.go. Specifically, it is missing:

  • minSentTs (atomic.Uint64)
  • scanInterval (atomic.Int64)
  • lastAdjustTime (atomic.Time)
  • refreshMinSentResolvedTs() method
  • newChangefeedStatus signature update to accept syncPointInterval

This indicates that the cherry-pick is incomplete or missing a prerequisite commit that defines these fields and methods on changefeedStatus. Please verify and include the missing changes.

Comment on lines +46 to +50
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest. Note that newChangefeedStatusForTest will fail to compile due to the signature mismatch of newChangefeedStatus.

	status := newChangefeedStatusForTest(t, info)

Comment on lines +71 to +75
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest. Note that newChangefeedStatusForTest will fail to compile due to the signature mismatch of newChangefeedStatus.

	status := newChangefeedStatusForTest(t, info)

Comment on lines +92 to +96
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest. Note that newChangefeedStatusForTest will fail to compile due to the signature mismatch of newChangefeedStatus.

	status := newChangefeedStatusForTest(t, info)

Comment on lines +136 to +140
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest. Note that newChangefeedStatusForTest will fail to compile due to the signature mismatch of newChangefeedStatus.

	status := newChangefeedStatusForTest(t, info)

) *changefeedStatus {
t.Helper()

status := newChangefeedStatus(changefeedID, syncPointInterval)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

The call to newChangefeedStatus passes two arguments: newChangefeedStatus(changefeedID, syncPointInterval). However, newChangefeedStatus is defined in pkg/eventservice/dispatcher_stat.go with only one argument. This will cause a compilation error.

Comment on lines +45 to +49
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest(t, info).

		status := newChangefeedStatusForTest(t, info)

Comment on lines +111 to +115
<<<<<<< HEAD
status := newChangefeedStatus(info.GetChangefeedID())
=======
status := newChangefeedStatusForTest(t, info)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest(t, info).

		status := newChangefeedStatusForTest(t, info)

Comment on lines +158 to +162
<<<<<<< HEAD
status1 := newChangefeedStatus(info1.GetChangefeedID())
=======
status1 := newChangefeedStatusForTest(t, info1)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest(t, info1).

	status1 := newChangefeedStatusForTest(t, info1)

Comment on lines +167 to +171
<<<<<<< HEAD
status2 := newChangefeedStatus(info2.GetChangefeedID())
=======
status2 := newChangefeedStatusForTest(t, info2)
>>>>>>> 32e1ab58b (eventservice: event service use server level tz to avoid unncessary call and verbose log (#4836))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Unresolved merge conflict. Resolve by using newChangefeedStatusForTest(t, info2).

	status2 := newChangefeedStatusForTest(t, info2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/cherry-pick-not-approved do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. type/cherry-pick-for-release-8.5 This PR is cherry-picked to release-8.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants