Make gpstart work for walrep mirrors
All that was needed was to make sure mirrors are not started with
pg_ctl -w flag since the mirror is in recovery mode and will not
respond to PQPing messages.
Author: Jimmy Yih
Author: Marbin Tan
@@ -372,6 +372,7 @@ class SegmentStart(Command):
content = gpdb.getSegmentContentId()
port = gpdb.getSegmentPort()
datadir = gpdb.getSegmentDataDirectory()
+ role = gpdb.getSegmentRole()
# build backend options
b = PgCtlBackendOptions(port, dbid, numContentsInCluster)
@@ -379,6 +380,10 @@ class SegmentStart(Command):
b.set_utility(utilityMode)
b.set_special(specialMode)
+ # mirror will be in recovery mode so pg_ctl -w flag won't work
+ if role == gparray.ROLE_MIRROR:
+ noWait = True
+
# build pg_ctl command
c = PgCtlStartArgs(datadir, b, era, wrapper, wrapper_args, not noWait, timeout)
self.cmdStr = str(c) + ' 2>&1'
