Skip to content

[release-nextgen-202609] log(logger): only write sarama logs at debug level - #6987

Open
ti-chi-bot[bot] wants to merge 1 commit into
pingcap:release-nextgen-202609from
ti-chi-bot:cherry-pick-6982-to-release-nextgen-202609
Open

ti-chi-bot[bot] wants to merge 1 commit into
pingcap:release-nextgen-202609from
ti-chi-bot:cherry-pick-6982-to-release-nextgen-202609

Conversation

@ti-chi-bot

@ti-chi-bot ti-chi-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

This is an automated cherry-pick of #6982

Issue Number: close #6983

What is changed and how it works?

  • initSaramaLogger always installs the zap adapter instead of swapping in an io.Discard logger at info and above; sarama messages are written at debug level, so the log level alone decides whether they show up.
  • Because the adapter is kept, switching the level at runtime (/api/v2/log) turns sarama output on without a restart.
  • The level parameter of initSaramaLogger is dropped; initOptionalComponent parses the level only for the gRPC logger.

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Start a capture at info, write to sarama.Logger, and confirm nothing is written; then set the level to debug and confirm the message shows up.

Questions

Will it cause performance regression or break compatibility?

No.

Do you need to update user documentation, design documentation or monitoring documentation?

No.

Release note

None

Summary by CodeRabbit

  • Bug Fixes
    • Sarama log messages are now consistently routed through the application’s logging system at debug level, rather than being discarded or logged at the configured level. This may make additional Sarama diagnostic messages available in logs.

@ti-chi-bot

ti-chi-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown
Author

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 ti-chi-bot Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 25, 2026
@ti-chi-bot

ti-chi-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown
Author

[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 nongfushanquan 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

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f96dd99-c0a7-45d9-a2a8-f2d38d411273

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

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@ti-chi-bot ti-chi-bot Bot added contribution This PR is from a community contributor. first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. labels Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contribution This PR is from a community contributor. do-not-merge/cherry-pick-not-approved first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/cherry-pick-for-release-nextgen-202609

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant