Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not log config when the config is not changed #694

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Sep 27, 2024

What problem does this PR solve?

Issue Number: close #680

Problem Summary:
When the operator sets the label periodically, TiProxy keeps reporting the same config. Logs are too many.

What is changed and how it works:

  • Keep a byte format of the current config in the memory
  • Compare the latest config bytes with the original one, only log it, calculate checksum, and notify listeners when the config has changed

Check List

Tests

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

Notable changes

  • Has configuration change
  • Has HTTP API interfaces change
  • Has tiproxyctl change
  • Other user behavior changes

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

- Do not log config when the config is not changed

Copy link

ti-chi-bot bot commented Sep 27, 2024

[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 ask for approval from djshow832, ensuring that each of them provides their approval before proceeding. For more information see the Code Review Process.

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

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 requested review from bb7133 and xhebox September 27, 2024 08:54
@ti-chi-bot ti-chi-bot bot added the size/M label Sep 27, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@26c66bc). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/manager/config/config.go 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #694   +/-   ##
=======================================
  Coverage        ?   70.02%           
=======================================
  Files           ?      105           
  Lines           ?    10017           
  Branches        ?        0           
=======================================
  Hits            ?     7014           
  Misses          ?     2511           
  Partials        ?      492           
Flag Coverage Δ
unit 70.02% <78.57%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not log config when the new config is the same
2 participants