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

config, cmd: fix that the proxy configs are overwritten #691

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

djshow832
Copy link
Collaborator

@djshow832 djshow832 commented Sep 26, 2024

What problem does this PR solve?

Issue Number: close #690

Problem Summary:
When --advertise-addr is set, the whole proxy is overwritten by toml.Unmarshal(e.overlay, base), which results in all the fields are empty except for advertise-addr.

What is changed and how it works:

  • Remove Sctx.Overlay and add Sctx.AdvertiseAddr
  • Only set advertiseAddr explicitly in ConfigManager

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code
  1. Set the graceful-wait-before-shutdown in the config file
  2. Start TiProxy with --advertise-addr
  3. Start TiProxy and check the log, the config shows graceful-wait-before-shutdown correctly

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.

- Fix that the `proxy` configurations are overwritten when the command line `--advertise-addr` is set.

@ti-chi-bot ti-chi-bot bot requested review from bb7133 and xhebox September 26, 2024 09:50
@ti-chi-bot ti-chi-bot bot added the size/M label Sep 26, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@4471d26). Learn more about missing BASE report.

Files with missing lines Patch % Lines
pkg/server/server.go 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #691   +/-   ##
=======================================
  Coverage        ?   70.35%           
=======================================
  Files           ?      103           
  Lines           ?     9891           
  Branches        ?        0           
=======================================
  Hits            ?     6959           
  Misses          ?     2443           
  Partials        ?      489           
Flag Coverage Δ
unit 70.35% <66.66%> (?)

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.

Copy link

ti-chi-bot bot commented Sep 27, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xhebox

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

The pull request process is described 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 added the lgtm label Sep 27, 2024
Copy link

ti-chi-bot bot commented Sep 27, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-27 01:54:21.971167619 +0000 UTC m=+1790131.711591823: ☑️ agreed by xhebox.

@ti-chi-bot ti-chi-bot bot added the approved label Sep 27, 2024
@ti-chi-bot ti-chi-bot bot merged commit 4243fb5 into pingcap:main Sep 27, 2024
5 checks passed
@djshow832 djshow832 deleted the graceful branch September 27, 2024 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

the config graceful-wait-before-shutdown doesn't take effect
3 participants