[GG-181] Use intermediate host for swap moves#2248
Merged
bimboterminator1 merged 13 commits intofeature/ADBDEV-6608from Mar 6, 2026
Merged
[GG-181] Use intermediate host for swap moves#2248bimboterminator1 merged 13 commits intofeature/ADBDEV-6608from
bimboterminator1 merged 13 commits intofeature/ADBDEV-6608from
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
whitehawk
reviewed
Feb 19, 2026
whitehawk
reviewed
Feb 19, 2026
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
bimboterminator1
left a comment
There was a problem hiding this comment.
it would be nice to see cases of cluster configuration, where several swaps are required
I couldn't come up with 3 host configuration where 2 swaps is required so far
This comment was marked as resolved.
This comment was marked as resolved.
whitehawk
reviewed
Feb 20, 2026
Member
Author
occured after suggested refactoring, fixed |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
whitehawk
reviewed
Feb 24, 2026
| # Try parent directory | ||
| parent_dir = TemplateParser.extract_parent_directory(directory) | ||
| if parent_dir in self.space_info_by_host[host_address]: | ||
| return self.space_info_by_host[host_address][parent_dir] |
There was a problem hiding this comment.
I suggest adding explicit return at the end of the function:
Suggested change
| return self.space_info_by_host[host_address][parent_dir] | |
| return self.space_info_by_host[host_address][parent_dir] | |
| return None |
This comment was marked as resolved.
This comment was marked as resolved.
whitehawk
reviewed
Feb 26, 2026
Member
Author
I'll check it out. |
Member
Author
Now it's ok. rebalance_basics are adjusted in order to avoid demo cluster recreation each time |
|
It looks that unit tests don't pass on latest code version: log |
whitehawk
reviewed
Mar 2, 2026
|
Typo in the description: |
whitehawk
approved these changes
Mar 3, 2026
|
Approving the PR, but please fix the couple of the remaining minor issues. |
silent-observer
approved these changes
Mar 5, 2026
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.
Previously, primary and mirror could coexist at the same host during
execution of moves, where segments just swap their hosts. This violates
the HA rule for the whole cluster.
When the suboptimal rebalance plan requires swapping the locations
of a primary segment and its mirror, the planner now decomposes
this into three safe phases using an intermediate host to prevent
primary-mirror coexistence violations.
planner.py now detects swap moves in form_moves() and
chooses the appropriate 3rd host for mirror movement.
The search is performed based on available space, considering
other moves, host status, and on other swap counts.
Thus, plan, which previously looked like:
now expands into three moves
Moreover, available space check for intermediate host now uses
cached filesystem info. Thus, the ResourceEstimator class is refactored.
It's unit tests are adjusted.
Additionally some unit tests were fixed, because we've forgotten to check them
in previous patches.
Example of configuration with single swap for manual testing:
conf