From 6e1770b4031b9b5891bf22f6b656dfb4ec9972e2 Mon Sep 17 00:00:00 2001 From: openGaussDev Date: Wed, 9 Mar 2022 20:28:45 +0800 Subject: [PATCH] just calculate RTO when apply lsn update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Offering: openGaussDev More detail: 可选 Match-id-1a6bcef19603d8a1f43286bec3a350c2760f0a0f --- src/gausskernel/storage/replication/walsender.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gausskernel/storage/replication/walsender.cpp b/src/gausskernel/storage/replication/walsender.cpp index 2232dc1e4..7c8844fe2 100755 --- a/src/gausskernel/storage/replication/walsender.cpp +++ b/src/gausskernel/storage/replication/walsender.cpp @@ -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 {