-
Notifications
You must be signed in to change notification settings - Fork 86
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
[hostcfgd] Fix issue: FeatureHandler might override user configuration #58
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
keboliu
approved these changes
Apr 25, 2023
Hi @ganglyu , would you please kindly review? |
ganglyu
approved these changes
Apr 26, 2023
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.
LGTM
dgsudharsan
approved these changes
Apr 26, 2023
Hi @ganglyu , could you please help merge this? |
It causes UT failure after cherry-picking to 202211, so I created a backport PR for 202211: #59 |
liat-grozovik
pushed a commit
that referenced
this pull request
May 4, 2023
…figuration (#58) (#59) - Why I did this? hostcfgd is using a subscribe/listen way to handle configuration data. It handles feature configuration like this: subscribe to CONFIG DB FEATURE table read initial data from CONFIG DB FEATURE table and call FeatureHandler.sync_state_field to process the initial data As FEATURE table "state" field might be a template, FeatureHandler is responsible for rendering it FeatureHandler will "resync" the rendered "state" back to CONFIG DB However, if there is a user configuration occurs between step 2 and step 3, user configuration will be silently ignored and override. Here is an example: subscribe to CONFIG DB FEATURE table read initial FEATURE data, say sflow.state = disabled. FeatureHandler.sync_state_field get an input that "sflow.state = disabled" user issued command "config feature state sflow enabled". Now sflow.state is enabled in FEATURE table. FeatureHandler.sync_state_field continues running and resync "sflow.state = disabled" back to FEATURE table In this case, user configuration in step#3 will be override. The PR is a fix for this issue. - How I verified? Added new unit test
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
Cherry Pick Conflict_202211
Included in 202211
Request for 202205 Branch
Request for 202211 Branch
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why I did this?
hostcfgd is using a subscribe/listen way to handle configuration data. It handles feature configuration like this:
However, if there is a user configuration occurs between step 2 and step 3, user configuration will be silently ignored and override. Here is an example:
In this case, user configuration in step#3 will be override. The PR is a fix for this issue.
How I verified?
Added new unit test