mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
runtime_options.wal_keep_segments is prepopulated with default value
Explicitly track if setting came from command line parameter.
This commit is contained in:
6
repmgr.c
6
repmgr.c
@@ -131,6 +131,7 @@ main(int argc, char **argv)
|
|||||||
int c, targ;
|
int c, targ;
|
||||||
int action = NO_ACTION;
|
int action = NO_ACTION;
|
||||||
bool check_master_config = false;
|
bool check_master_config = false;
|
||||||
|
bool wal_keep_segments_used = false;
|
||||||
char *ptr = NULL;
|
char *ptr = NULL;
|
||||||
|
|
||||||
progname = get_progname(argv[0]);
|
progname = get_progname(argv[0]);
|
||||||
@@ -186,7 +187,10 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 'w':
|
case 'w':
|
||||||
if (atoi(optarg) > 0)
|
if (atoi(optarg) > 0)
|
||||||
|
{
|
||||||
strncpy(runtime_options.wal_keep_segments, optarg, MAXLEN);
|
strncpy(runtime_options.wal_keep_segments, optarg, MAXLEN);
|
||||||
|
wal_keep_segments_used = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
if (atoi(optarg) > 0)
|
if (atoi(optarg) > 0)
|
||||||
@@ -449,7 +453,7 @@ main(int argc, char **argv)
|
|||||||
* the version check for 9.4 or later will occur afterwards.
|
* the version check for 9.4 or later will occur afterwards.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(options.use_replication_slots && strlen(runtime_options.wal_keep_segments))
|
if(options.use_replication_slots && wal_keep_segments_used)
|
||||||
{
|
{
|
||||||
log_warning(_("-w/--wal-keep-segments has no effect when replication slots in use\n"));
|
log_warning(_("-w/--wal-keep-segments has no effect when replication slots in use\n"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user