Pivotal Knowledge Base

Follow

How to separate full recovery and incremental recovery

Environment

Product Version
Pivotal Greenplum All Versions

Goal

Sometimes some segments need full recovery while some only need incremental recovery. We do not want to run full recovery by "gprecoverseg -F" for all of them and want to run incremental recovery and full recovery separately.

Solution

How to reproduce this scenario

In this scenario we will assume that DBID 6 needs incremental recovery while DBID13 needs full recovery.

Incremental recover

  • First recover the DBID 6
  • Generate an output_config and it contains both DBID 6 and 13
[gpadmin@mdw]$ gprecoverseg -o output_config
20120518:09:46:02:gprecoverseg:mdw:gpadmin-[INFO]:-Starting gprecoverseg with args: -o output_config
20120518:09:46:02:gprecoverseg:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.0 build 2'
20120518:09:46:02:gprecoverseg:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20120518:09:46:03:gprecoverseg:mdw:gpadmin-[INFO]:-Configuration file output to output_config successfully.

[gpadmin@mdw]$ cat output_config
filespaceOrder=
sdw3:46232:/data1/viadea4120mirror/gpsegviadea0
sdw6:46232:/data1/viadea4120mirror/gpsegviadea4
  • Remove the DBID 13 from output_config
[gpadmin@mdw]$ vim output_config
filespaceOrder=
sdw3:46232:/data1/viadea4120mirror/gpsegviadea0
  • Incremental recovery dbid 6
[gpadmin@mdw]$ gprecoverseg -i output_config
20120518:09:52:50:gprecoverseg:mdw:gpadmin-[INFO]:-Starting gprecoverseg with args: -i output_config
20120518:09:52:50:gprecoverseg:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.0 build 2'
20120518:09:52:50:gprecoverseg:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-Greenplum instance recovery parameters
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-Recovery from configuration -i option supplied
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-Recovery 1 of 1
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Synchronization mode                        = Incremental
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance host                        = sdw3
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance address                     = sdw3
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance directory                   = /data1/viadea4120mirror/gpsegviadea0
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance port                        = 46232
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Failed instance replication port            = 46432
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance host               = sdw1
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance address            = sdw1
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance directory          = /data1/viadea4120/gpsegviadea0
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance port               = 19463
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Source instance replication port   = 46332
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:-   Recovery Target                             = in-place
20120518:09:52:51:gprecoverseg:mdw:gpadmin-[INFO]:----------------------------------------------------------
 
Continue with segment recovery procedure Yy|Nn (default=N):
> y
(...)
  • Make sure DBID 6 finishes recovery and only then move to DBID 13.
[gpadmin@mdw]$ gpstate -e
20120518:09:54:52:gpstate:mdw:gpadmin-[INFO]:-Starting gpstate with args: -e
20120518:09:54:52:gpstate:mdw:gpadmin-[INFO]:-local Greenplum Version: 'postgres (Greenplum Database) 4.1.2.0 build 2'
20120518:09:54:52:gpstate:mdw:gpadmin-[INFO]:-Obtaining Segment details from master...
20120518:09:54:52:gpstate:mdw:gpadmin-[INFO]:-Gathering data from segments...
..
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-Segment Mirroring Status Report
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-----------------------------------------------------
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-Primaries in Change Tracking
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-   Current Primary   Port    Change tracking size   Mirror   Port
20120518:09:54:54:gpstate:mdw:gpadmin-[INFO]:-   sdw4              19463   106 MB                 sdw6     46232

Full recover

To recover the DBID 13 you can now use.

gprecoverseg -F

Comments

Powered by Zendesk