just calculate RTO when apply lsn update

Offering: openGaussDev

More detail: 可选

Match-id-1a6bcef19603d8a1f43286bec3a350c2760f0a0f
This commit is contained in:
openGaussDev 2022-03-09 20:28:45 +08:00 committed by yanghao
parent 2c01f72e88
commit 6e1770b403
1 changed files with 4 additions and 2 deletions

View File

@ -3014,8 +3014,10 @@ static void LogCtrlCalculateCurrentRTO(StandbyReplyMessage *reply, bool *needRef
}
if ((walsnd->log_ctrl.apply_rate >> SHIFT_SPEED) > 1) {
if (calculate_time_diff > CALCULATE_INTERVAL_MILLISECOND || IsRtoRpoOverTarget()) {
walsnd->log_ctrl.apply_rate = LogCtrlCountBigSpeed(walsnd->log_ctrl.apply_rate,
(uint64)(periodTotalApply / calculate_time_diff));
if (needApply != 0) {
walsnd->log_ctrl.apply_rate = LogCtrlCountBigSpeed(walsnd->log_ctrl.apply_rate,
(uint64)(periodTotalApply / calculate_time_diff));
}
walsnd->log_ctrl.prev_calculate_time = reply->sendTime;
}
} else {