fix: preserve backend volume associations during reconciliation#1167
Open
s-starostin wants to merge 1 commit into
Open
fix: preserve backend volume associations during reconciliation#1167s-starostin wants to merge 1 commit into
s-starostin wants to merge 1 commit into
Conversation
Contributor
|
If you wish to contribute to Trident please complete the necessary steps outlined in the CONTRIBUTING.md file, including the signed CCLA. Sign and submit NetApp's Contributor License Agreement. You must sign and submit the Corporate Contributor License Agreement (CCLA) in order to contribute. |
Author
|
Thanks. The CCLA has been submitted for VI.Tech and includes my GitHub username, @s-starostin. Please let me know if any additional information is required. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change description
Preserve backend volume associations during concurrent backend reconciliation.
When controller concurrency is enabled, periodic backend reconciliation may replace an existing backend object with a newly initialized backend object. The replacement backend starts with an empty backend-local volume map.
The global volume cache remains intact, so
tridentctl get volumecontinues to return all managed volumes with the correct backend UUIDs. However,tridentctl get backendreportsVOLUMES=0because the replacement backend no longer contains the existing volume associations.The empty backend-local volume map may also affect node access reconciliation because backend volume associations are consulted before the replacement backend is written to the concurrent cache.
This change copies the existing backend-local volume associations from the original backend to the replacement backend before node access reconciliation and cache replacement.
The copy is performed entirely in memory and does not call the storage driver for every volume. Explicit backend update workflows continue to use the existing volume validation path where storage-side validation is required.
Fixes #1166
Project tracking
External community bug fix tracked by GitHub issue #1166 .
Do any added TODOs have an issue in the backlog?
No TODOs added.
Did you add unit tests? Why not?
Yes.
Added focused unit coverage for copying backend volume associations, including:
Extended concurrent backend reconciliation coverage to verify that a backend replacement caused by a backend pools change preserves all existing backend volume associations.
The regression test verifies that both the global volume cache and the replacement backend-local volume map remain populated after
reconcileBackendState.Does this code need functional testing?
Yes.
Targeted functional validation is recommended because the issue is triggered by periodic backend reconciliation with controller concurrency enabled.
The functional validation should:
tridentctl get backendreports the expected volume counts after bootstrap.tridentctl get volumecontinues to return the same volumes and backend UUIDs.Is a code review walkthrough needed? why or why not?
Yes, a brief walkthrough is recommended.
The code change is small, but its placement is important. Existing volume associations must be copied to the replacement backend before node access reconciliation and before the backend is replaced in the concurrent cache.
The walkthrough should also confirm that the existing concurrent cache locking guarantees prevent volume association changes while the backend replacement is in progress.
Should additional test coverage be executed in addition to pre-merge?
Yes.
In addition to the standard pre-merge test suite, run the focused concurrent-core tests with the Go race detector and repeat the reconciliation regression test multiple times.
Recommended validation:
Does this code need a note in the changelog?
/needs-changelog
This affects backend state reporting and backend-to-volume associations when controller concurrency is enabled.
Changelog
Fixed concurrent backend reconciliation to preserve existing backend volume associations when replacing a backend object.
Does this code require documentation changes?
No.
Additional Information
The issue was reproduced with controller concurrency enabled.
Observed behavior:
onlineandnormal;tridentctl get backendreportedVOLUMES=0;volumesarrays;tridentctl get volumecontinued to return all managed volumes with valid backend UUIDs;The behavior was reproduced on released versions v26.02.1 and v26.06.0.
Example observed state on v26.06.0:
At the same time, the global volume cache remained populated: