提交 ba3eb5b4 编写于 作者: J Jacob Champion

gpinitstandby: rename -F to -S and document it

After the WALrep changes, the previous -F (filespace) option was
co-opted to be the new standby data directory option. This isn't a
particularly obvious association.

Change the option to -S. (-D would have been better, but that's already
in use as a short alias for --debug.) Also document this option in the
official gpinitstandby help.
上级 c9c3c351
......@@ -116,7 +116,7 @@ def parseargs():
help='hostname of system to create standby master on')
optgrp.add_option('-P', '--standby-port', type='int', dest='standby_port',
help='port of system to create standby master on')
optgrp.add_option('-F', '--standby-datadir', type='string', dest='standby_datadir',
optgrp.add_option('-S', '--standby-datadir', type='string', dest='standby_datadir',
help='datadir of standby master')
optgrp.add_option('-n', '--no-update', action='store_true', dest='no_update',
help='do not update system catalog tables')
......@@ -155,9 +155,9 @@ def parseargs():
logger.error('Options -s and -n cannot be specified together.')
parser.exit(2, None)
# -F and -n are exclusive
# -S and -n are exclusive
if options.standby_datadir and options.no_update:
logger.error('Options -F and -n cannot be specified together.')
logger.error('Options -S and -n cannot be specified together.')
parser.exit(2, None)
# -s and -r are exclusive
......@@ -593,7 +593,7 @@ def validate_standby_init(options, array, standby_datadir):
if options.standby_host == array.master.hostname:
logger.error(
'If you want to initialize a new standby on the same host as '
'the master (not recommended), use -F and -P to specify a new '
'the master (not recommended), use -S and -P to specify a new '
'data directory and port'
)
raise GpInitStandbyException('master data directory exists')
......
......@@ -1544,7 +1544,7 @@ CREATE_STANDBY_QD () {
INIT_STANDBY_ARGS+=" -P $STANDBY_PORT"
fi
if [ x"" != x"$STANDBY_DATADIR" ]; then
INIT_STANDBY_ARGS+=" -F $STANDBY_DATADIR"
INIT_STANDBY_ARGS+=" -S $STANDBY_DATADIR"
fi
if [ $HBA_HOSTNAMES -eq 1 ]; then
INIT_STANDBY_ARGS+=" --hba-hostnames"
......
......@@ -9,7 +9,7 @@ SYNOPSIS
gpinitstandby { -s <standby_hostname> [-P <port>] | -r | -n }
[-a] [-q] [-D] [-l <logfile_directory>]
[-a] [-q] [-D] [-S <standby data directory>] [-l <logfile_directory>]
gpinitstandby -? | -v
......@@ -99,7 +99,16 @@ OPTIONS
If the Greenplum Database standby master is on the same host as the
active master, the ports must be different. If the ports are the same
for the active and standby master and the host is the same, the utility
returns an error.
returns an error. (See also -S.)
-S <standby data directory>
The data directory to use for a new standby master. The default is the same
directory used by the active master.
If the standby master is on the same host as the active master, a different
directory must be provided using this option. (See also -P.)
-q
......
......@@ -14,7 +14,7 @@ Feature: Tests for gpinitstandby feature
When the user initializes a standby on the same host as master and the same data directory
Then gpinitstandby should return a return code of 2
And gpinitstandby should print "master data directory exists" to stdout
And gpinitstandby should print "use -F and -P to specify a new data directory and port" to stdout
And gpinitstandby should print "use -S and -P to specify a new data directory and port" to stdout
Scenario: gpinitstandby exclude dirs
Given the database is running
......
......@@ -637,7 +637,7 @@ def run_gpinitstandby(context, hostname, port, standby_data_dir, options='', rem
# We do not set port nor data dir here to test gpinitstandby's ability to autogather that info
cmd = "gpinitstandby -a -s %s" % hostname
else:
cmd = "gpinitstandby -a -s %s -P %s -F %s" % (hostname, port, standby_data_dir)
cmd = "gpinitstandby -a -s %s -P %s -S %s" % (hostname, port, standby_data_dir)
run_gpcommand(context, cmd + ' ' + options)
......@@ -729,7 +729,7 @@ def impl(context):
# We do not set port nor data dir here to test gpinitstandby's ability to autogather that info
cmd = "gpinitstandby -a -s %s" % context.master_hostname
else:
cmd = "gpinitstandby -a -s %s -P %s -F %s" % (context.master_hostname, context.master_port, master_data_dir)
cmd = "gpinitstandby -a -s %s -P %s -S %s" % (context.master_hostname, context.master_port, master_data_dir)
context.execute_steps(u'''Then the user runs command "%s" from standby master''' % cmd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册