Skip to content

Implement proper parallel flow of the rebalance execution#2243

Merged
whitehawk merged 13 commits intofeature/ADBDEV-6608from
GG-102
Feb 5, 2026
Merged

Implement proper parallel flow of the rebalance execution#2243
whitehawk merged 13 commits intofeature/ADBDEV-6608from
GG-102

Conversation

@whitehawk
Copy link

@whitehawk whitehawk commented Jan 29, 2026

Implement proper parallel flow of the rebalance execution

Problem description:
Need to update rebalance execution flow in a way that it can support parallel
segment movement, and at the same time the flow must consider following
limitations:

  • ggrebalance should save every move step and it's status in persistance
    storage so that failed steps may be retried, rollbacked or cancelled (rollback,
    retry or cancel of particular movement will be implemented later in a separate
    patch);
  • switchover actions (primary to mirror, mirror to primary) will require user
    approval once we implement interactive mode (later in a separate patch);
  • ggrebalance should consider the order of the planned movements in the
    primary-mirror swap scenario using 3rd intermediate, transitional host. It means
    that the executor can't swap the order of mirror and primary movements.

Therefore, this patch:

  1. Adds an entity of RebalanceStep, that contain the state of execution together
    with the movement definition. List of such steps is now saved to the rebalance
    schema.
  2. Updates the state machine of the rebalance execution. Now new states, where
    approval will be later requested from the user, are added. And the state machine
    can switch between segment processing and approval request as many times as
    required, till all steps are processed. Execution of the rebalance steps is
    performed in batches. Each batch is comprised from the same type of rebalance
    steps, without duplication of dbids.
  3. Updates the code to use '--parallel' option to config
    'gpmovemirrors'/'gprecoverseg'.
  4. Updates behave tests according to changes described above.

@whitehawk whitehawk changed the title GG-102 Implement proper parallel flow of the rebalance execution Jan 29, 2026
@whitehawk whitehawk marked this pull request as ready for review January 29, 2026 07:05
Copy link

@hilltracer hilltracer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Finally, behave tests are passed

1 feature passed, 0 failed, 26 skipped
32 scenarios passed, 0 failed, 808 skipped
1274 steps passed, 0 failed, 13181 skipped, 0 undefined
Took 550m51.963s
make: Leaving directory '/home/gpadmin/gpdb_src/gpMgmt'

@whitehawk whitehawk merged commit 28ebc24 into feature/ADBDEV-6608 Feb 5, 2026
1 check passed
@whitehawk whitehawk deleted the GG-102 branch February 5, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants