Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@whitehawk
Copy link

@whitehawk whitehawk commented Jan 22, 2025

DRAFT, not for commit (and most likely will not pass the CI).

Decrease non-HA mode during gprecoverseg (quick & dirty proto).
This patch moves stopping of mirror segments after the execution of pg_basebackup.
This patch aims only to show feasibility of the approach.

Updates in tests:

  1. As the new gprecoverseg flow in the prototype calls gpsegrecovery.py twice (1st time to do only pg_basebackup and second - to start new mirrors), some tests were updated to check that "$GPHOME/sbin/gpsegrecovery.py" was called 2 times instead of 1.
  2. As now the time when mirrors are down is sighficantly reduced, test steps with "user waits until mirror is down" were removed, as the check for mirror down can miss the time window when the mirror is actually down (as result, these steps will be timed out).

Note: better to check with 'Hide whitespace' option enabled.


Scenario:

Step 1 - create demo cluster

Step 2 - create config file for gpmovemirrors, in my case it is /tmp/config_mov with following content:

reskin-VirtualBox|7005|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror1/demoDataDir0 reskin-VirtualBox|7005|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_1_new/demoDataDir0
reskin-VirtualBox|7006|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror2/demoDataDir1 reskin-VirtualBox|7006|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_2_new/demoDataDir1
reskin-VirtualBox|7007|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror3/demoDataDir2 reskin-VirtualBox|7007|/usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_3_new/demoDataDir2

Step 3 - call gpmovemirrors -i /tmp/config_mov -v

Step 4 - verify that mirrors were successfully moved:

reskin@reskin-VirtualBox:/usr/re/share/ws103-ADBDEV-6860/gpdb$ psql postgres -c "select * from gp_segment_configuration order by dbid;"
 dbid | content | role | preferred_role | mode | status | port |     hostname      |      address      |                                datadir                                
------+---------+------+----------------+------+--------+------+-------------------+-------------------+-----------------------------------------------------------------------
    1 |      -1 | p    | p              | n    | u      | 7000 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/qddir/demoDataDir-1
    2 |       0 | p    | p              | s    | u      | 7002 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast1/demoDataDir0
    3 |       1 | p    | p              | s    | u      | 7003 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast2/demoDataDir1
    4 |       2 | p    | p              | s    | u      | 7004 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast3/demoDataDir2
    5 |       0 | m    | m              | s    | u      | 7005 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_1_new/demoDataDir0
    6 |       1 | m    | m              | s    | u      | 7006 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_2_new/demoDataDir1
    7 |       2 | m    | m              | s    | u      | 7007 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/dbfast_mirror_3_new/demoDataDir2
    8 |      -1 | m    | m              | s    | u      | 7001 | reskin-VirtualBox | reskin-VirtualBox | /usr/re/share/ws103-ADBDEV-6860/data/standby
(8 rows)

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