Skip to content

[ADBDEV-8481] Add gp_rebalance_numsegments reset check#1977

Merged
bimboterminator1 merged 7 commits intofeature/ADBDEV-6608from
ADBDEV-8481
Oct 16, 2025
Merged

[ADBDEV-8481] Add gp_rebalance_numsegments reset check#1977
bimboterminator1 merged 7 commits intofeature/ADBDEV-6608from
ADBDEV-8481

Conversation

@bimboterminator1
Copy link
Member

@bimboterminator1 bimboterminator1 commented Oct 14, 2025

Add gp_rebalance_numsegments reset check

This patch adds a check for probable scenario when during interruption of
ggrebalance the cluster could be restarted. In this case the shared variable
gp_rebalance_numsegments is unset, and new table may be created at old segment
count. Thus, during recovering of shrink process the STATE_CHECK_PREVIOUS_RUN
callback calls get_state_after_interrupt() function, which checks the mentioned
situation. If cluster is restarted the state machine executes transition to
STATE_BACKUP_CATALOG_AND_UPDATE_TARGET_SEGMENT_COUNT_STARTED state.

The interface for gp_rebalance_numsegments variable is updated via
gp_rebalance_numsegments_is_set() SQL function in order to provide convenient way
to monitor variable status. Before that, the comparison with INT_MAX value was required.

Additionally, fault injection interface was returned to behave tests to cause
workflow interruptions. The behave tests utility code was also adjusted to
support some of the shrink scenarios. The code related to table population
is fixed to make it follow declared semantics. gpaddmirrors test is updated
as well.

Co-Authored-By: Roman Eskin r.eskin@arenadata.io

This patch adds check for probable scenario when after interruption of
ggrebalance the cluster could be restarted. In this case shared variable
gp_rebalance_numsegments is unset, and new table may be created at old segment
count. Thus, during recovering of shrink process the STATE_CHECK_PREVIOUS_RUN
callback calls get_state_after_interrupt() function, which checks the mentioned
situation. If cluster is restarted the state machine executes transition to
STATE_BACKUP_CATALOG_AND_UPDATE_TARGET_SEGMENT_COUNT_STARTED state.

Additionally, fault injection interface was returned to behave tests to cause
workflow interruptions. The behave tests utility code was also adjusted to
support some of the shrink scenarios.

Co-Authored-By: Roman Eskin <r.eskin@arenadata.io>
@bimboterminator1 bimboterminator1 merged commit 1134de6 into feature/ADBDEV-6608 Oct 16, 2025
1 check passed
@bimboterminator1 bimboterminator1 deleted the ADBDEV-8481 branch October 16, 2025 17:14
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