!171 gs_basebackup occasionally failed when compress=9

Merge pull request !171 from 吴岳川/master
This commit is contained in:
opengauss-bot
2020-09-02 17:42:52 +08:00
committed by Gitee
5 changed files with 23 additions and 3 deletions

View File

@ -461,6 +461,7 @@ wal_sender_timeout|int|0,2147483647|ms|If the host larger data rebuild operation
wal_sync_method|enum|fsync,fsync_writethrough,fdatasync,open_sync,open_datasync|NULL|If fsync set to off, this parameter setting does not make sense, because all data updates are not forced to be written to disk.|
wal_writer_delay|int|1,10000|ms|If the time is too long will cause WAL buffers memory shortage, time is too short will cause WAL continue to write, increase disk I/O burden.|
walsender_max_send_size|int|8,2147483647|kB|NULL|
basebackup_timeout|int|0,2147483647|s|NULL|
wal_compression|bool|0,0|NULL|NULL|
work_mem|int|64,2147483647|kB|For complex queries, it may run several concurrent sort or hash operation, each of which can use the amount of memory that this parameter is declared using the temporary file is insufficient. Also, several running sessions could be sorted the same time. Therefore, the total memory usage may be work_mem several times.|
xloginsert_locks|int|1,1000|NULL|NULL|

View File

@ -1972,7 +1972,7 @@ static int GsBaseBackup(int argc, char** argv)
case 'Z':
check_env_value_c(optarg);
compresslevel = atoi(optarg);
if (compresslevel <= 0 || compresslevel > 9) {
if (compresslevel < 0 || compresslevel > 9) {
fprintf(stderr, _("%s: invalid compression level \"%s\"\n"), progname, optarg);
exit(1);
}

View File

@ -401,7 +401,8 @@ const char* sync_guc_variable_namelist[] = {"work_mem",
"enable_incremental_catchup",
"wait_dummy_time",
"max_recursive_times",
"sql_use_spacelimit"};
"sql_use_spacelimit",
"basebackup_timeout"};
static void set_config_sourcefile(const char* name, char* sourcefile, int sourceline);
static bool call_bool_check_hook(struct config_bool* conf, bool* newval, void** extra, GucSource source, int elevel);
@ -5004,6 +5005,23 @@ static void init_configure_names_int()
NULL,
NULL
},
{
{
"basebackup_timeout",
PGC_USERSET,
WAL_SETTINGS,
gettext_noop("Sets the timeout in seconds for a reponse from gs_basebackup."),
NULL,
GUC_UNIT_S
},
&u_sess->attr.attr_storage.basebackup_timeout,
60 * 10,
0,
INT_MAX,
NULL,
NULL,
NULL
},
{
{
"wal_receiver_connect_timeout",

View File

@ -1755,7 +1755,7 @@ static bool HandleWalReplicationCommand(const char* cmd_string)
/* Send CommandComplete and ReadyForQuery messages */
EndCommand_noblock("SELECT", DestRemote);
ReadyForQuery_noblock(DestRemote, u_sess->attr.attr_storage.wal_sender_timeout);
ReadyForQuery_noblock(DestRemote, u_sess->attr.attr_storage.basebackup_timeout * MILLISECONDS_PER_SECONDS);
/* ReadyForQuery did pq_flush for us */
/* Audit database recovery */
pgaudit_system_recovery_ok();

View File

@ -83,6 +83,7 @@ typedef struct knl_session_attr_storage {
int wal_receiver_timeout;
int wal_receiver_connect_timeout;
int wal_receiver_connect_retries;
int basebackup_timeout;
int max_loaded_cudesc;
int num_temp_buffers;
int psort_work_mem;