-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Improve VTOrc config handling to support dynamic variables #17218
Improve VTOrc config handling to support dynamic variables #17218
Conversation
Signed-off-by: Manan Gupta <[email protected]>
…nce poll seconds Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
…o viper Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17218 +/- ##
==========================================
- Coverage 67.40% 67.39% -0.02%
==========================================
Files 1574 1574
Lines 253221 253251 +30
==========================================
- Hits 170690 170670 -20
- Misses 82531 82581 +50 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manan Gupta <[email protected]>
viperutil.Options[time.Duration]{ | ||
FlagName: "instance-poll-time", | ||
Default: 5 * time.Second, | ||
Dynamic: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the field dynamic
} | ||
|
||
// acceptSighupSignal registers for SIGHUP signal from the OS to reload the configuration files. | ||
func acceptSighupSignal() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuptaManan100 double-checking: the 3rd party library handles SIGHUP
reload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIGHUP is not even required anymore. Viper has a watcher on the file, and if it changes, it automatically reloads the configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuptaManan100 looks good to me, added one question re: SIGHUP
reload that I assume still functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add tests to replace the ones that were deleted. Ideally an e2e test that changes the file contents and verifies that the in-memory value does change.
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
…able Signed-off-by: Manan Gupta <[email protected]>
I added a e2e test to check that the configs are indeed reloading dynamically. I, however, only added it for one of the configs. Would you prefer if I added one for each of the reloadable configurations? |
Signed-off-by: Manan Gupta <[email protected]>
we can add all of the configs into the same test. |
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
…able Signed-off-by: Manan Gupta <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of small suggestions. Otherwise LGTM
…able Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Signed-off-by: Manan Gupta <[email protected]>
Description
This PR changes how config files are handled in VTOrc, moving them to use viper instead of the custom solution previously employed. This change allows the following parameters to be dynamically loaded -
instance-poll-time
prevent-cross-cell-failover
snapshot-topology-interval
reasonable-replication-lag
audit-to-backend
audit-to-syslog
audit-purge-duration
wait-replicas-timeout
tolerable-replication-lag
topo-information-refresh-duration
recovery-poll-duration
allow-emergency-reparent
change-tablets-with-errant-gtid-to-drained
Related Issue(s)
Checklist
Deployment Notes