20210407:13:20:33:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Starting to modify pg_hba.conf on primary segments to allow replication connections 20210407:13:20:39:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Successfully modified pg_hba.conf on primary segments to allow replication connections 20210407:13:20:39:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-1 segment(s) to recover 20210407:13:20:39:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Ensuring 1 failed segment(s) are stopped 20210407:13:20:40:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Ensuring that shared memory is cleaned up for stopped segments 20210407:13:20:40:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Validating remote directories 20210407:13:20:41:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Configuring new segments gpdb-tablespace-1 (dbid 9): 127267/216587 kB (58%), 0/2 tablespaces (...GPDB_6_301908232/16384/16384_fsm) gpdb-tablespace-1 (dbid 9): pg_basebackup: base backup completed 20210407:13:20:45:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Updating configuration with new mirrors 20210407:13:20:45:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Updating mirrors 20210407:13:20:45:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Starting mirrors 20210407:13:20:45:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-era is f60ff30cbbc77b9d_210405112734 20210407:13:20:45:014421 gprecoverseg:gpdb-tablespace-m:gpadmin-[INFO]:-Commencing parallel segment instance startup, please wait...
The gprecoverseg for a full recovery completes when the data is fully copied from primary to mirror. Therefore, there is no need to monitor the resync of data for a full recovery using gpstate.
However, this will mean that the gprecoverseg process will not take longer to complete compared to VMware Tanzu Greenplum 4 and VMware Tanzu Greenplum 5, but the overall recovery (including the data resync) is quicker.
An Incremental recovery uses pg_rewind to copy the contents that is in the changetracking log.
Firstly, the pg_rewind does a scan of all of the files on the primary.
Note: We have seen that this process can take a long time to run if you see the dots after the statement.
[INFO]:-Running pg_rewind on required mirrors
Then you can monitor the pg_rewind scan with the following:
+ Check of the pg_rewind process gpssh -f hostfile -e "ps -ef | grep rewind" Once all of the rewind processes are done, the recovery will move to the next step. To verify it is still working : + Run "strace -p <rewind process number>" You will see and each lstats is taking sometime to move to the next lstat("<PATH / filenumber>", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
In VMware Tanzu Greenplum 6.14 and after, we should see the progress of the rewind in percentage form
For example:
20210111:08:52:52:021213 gprecoverseg:mdw-[INFO]:-Running pg_rewind on required mirrors mdw.vmware.com (dbid 2): Done! mdw.vmware.com (dbid 3): 50478/213442 kB (23%) copied mdw.vmware.com (dbid 2): Done! mdw.vmware.com (dbid 3): Done! 20210111:08:52:56:021213 gprecoverseg:mdw-[INFO]:-Starting mirrors
Then it will start the mirror and begin to resync the data from the primary to the mirror.
The gprecoverseg process completes when the mirror segment is up and when the resync process begins. Therefore, once the gprecoverseg is done, you will have to use gpstate to monitor the resync of the data.
Use gpstate -m to get summary segment 'Data Status':
20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:-------------------------------------------------------------- 20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:- Mirror Datadir Port Status Data Status 20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:- sdw2-lab1 /data/mirror/gp_6.15.0_202104031034_someguy_seg0 35070 Passive Synchronized 20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:- sdw2-lab1 /data/mirror/gp_6.15.0_202104031034_someguy_seg1 35071 Passive Synchronized 20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:- sdw1-lab1 /data/mirror/gp_6.15.0_202104031034_someguy_seg2 35070 Passive Not In Sync 20210408:11:57:09:000564 gpstate:mdw-lab1:gpadmin-[INFO]:- sdw1-lab1 /data/mirror/gp_6.15.0_202104031034_someguy_seg3 35071 Passive Not In Sync
20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:----------------------------------------------------- 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Segment Info 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Hostname = sdw2-lab1 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Address = sdw2-lab1 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Datadir = /data/primary/gp_6.15.0_202104031034_someguy_seg2 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Port = 30070 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Mirroring Info 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Current role = Primary 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Preferred role = Primary 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Mirror status = Not In Sync 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Status 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- PID = 16310 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Configuration reports status as = Up 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Database status = Up 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:----------------------------------------------------- 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Segment Info 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Hostname = sdw1-lab1 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Address = sdw1-lab1 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Datadir = /data/mirror/gp_6.15.0_202104031034_someguy_seg2 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Port = 35070 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Mirroring Info 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Current role = Mirror 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Preferred role = Mirror 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Mirror status = Streaming 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Replication Info 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- WAL Sent Location = 3/7C018C08 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- WAL Flush Location = 3/7C018C08 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- WAL Replay Location = 3/716B4E60 (177618344 bytes left) 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Status 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- PID = 28752 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Configuration reports status as = Up 20210412:16:27:36:024007 gpstate:mdw-lab1:gpadmin-[INFO]:- Segment status = Up