set wal_sender_timeout >= 30minutes for gs_probackup
This commit is contained in:
@ -1498,6 +1498,7 @@ static void knl_t_walsender_init(knl_t_walsender_context* walsender_cxt)
|
||||
walsender_cxt->restoreLogicalLogHead = NULL;
|
||||
walsender_cxt->isUseSnapshot = false;
|
||||
walsender_cxt->firstConfirmedFlush = InvalidXLogRecPtr;
|
||||
walsender_cxt->timeoutCheckInternal = 0;
|
||||
}
|
||||
|
||||
static void knl_t_tsearch_init(knl_t_tsearch_context* tsearch_cxt)
|
||||
|
||||
@ -3831,6 +3831,12 @@ static int WalSndLoop(WalSndSendDataCallback send_data)
|
||||
t_thrd.walsender_cxt.last_logical_xlog_advanced_timestamp = GetCurrentTimestamp();
|
||||
t_thrd.walsender_cxt.last_logical_slot_advanced_timestamp = GetCurrentTimestamp();
|
||||
t_thrd.walsender_cxt.waiting_for_ping_response = false;
|
||||
#define MINUTE_30 (30 * 60 * 1000) /* 30 minutes */
|
||||
t_thrd.walsender_cxt.timeoutCheckInternal = u_sess->attr.attr_storage.wal_sender_timeout;
|
||||
if (strcmp(u_sess->attr.attr_common.application_name, "gs_probackup") == 0 &&
|
||||
t_thrd.walsender_cxt.timeoutCheckInternal < MINUTE_30) {
|
||||
t_thrd.walsender_cxt.timeoutCheckInternal = MINUTE_30;
|
||||
}
|
||||
|
||||
ResourceOwner tmpOwner = t_thrd.utils_cxt.CurrentResourceOwner;
|
||||
Assert(!IsTransactionOrTransactionBlock() &&
|
||||
@ -7226,9 +7232,9 @@ static int WalSndTimeout()
|
||||
/* DataSender -> IdentifyMode */
|
||||
return u_sess->attr.attr_storage.wal_sender_timeout;
|
||||
} else if (walsnd->sendRole == SNDROLE_PRIMARY_BUILDSTANDBY) {
|
||||
return MULTIPLE_TIME * u_sess->attr.attr_storage.wal_sender_timeout;
|
||||
return MULTIPLE_TIME * t_thrd.walsender_cxt.timeoutCheckInternal;
|
||||
} else {
|
||||
return u_sess->attr.attr_storage.wal_sender_timeout;
|
||||
return t_thrd.walsender_cxt.timeoutCheckInternal;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2427,6 +2427,13 @@ typedef struct knl_t_walsender_context {
|
||||
/* Timestamp of the last check-timeout time in WalSndCheckTimeOut. */
|
||||
TimestampTz last_check_timeout_timestamp;
|
||||
|
||||
/*
|
||||
* Actual timeout for guc wal_sender_timeout, default value is wal_sender_timeout.
|
||||
* timeoutCheckInternal will greater than or equal to 30 minutes for gs_probackup. It is so
|
||||
* hackly of 30 minutes, but now, 30 minutes is enough.
|
||||
*/
|
||||
int timeoutCheckInternal;
|
||||
|
||||
/* Read data from WAL into xlogReadBuf, then compress it to compressBuf */
|
||||
char *xlogReadBuf;
|
||||
char *compressBuf;
|
||||
|
||||
Reference in New Issue
Block a user