[ISSUE #4936] Remove useless log output after the master and slave broker are started on the empty disk in controller mode (#4944)

* Fix invalid log output after the master and slave broker are started on the empty disk in controller mode

* Remove useless log output after the master and slave broker are started on the empty disk in controller mode
This commit is contained in:
rongtong
2022-08-31 16:07:12 +08:00
committed by GitHub
parent f1f8bcbc8b
commit 516e0d727b
@@ -509,9 +509,16 @@ public class AutoSwitchHAConnection implements HAConnection {
// Normal transfer method
private void buildTransferHeaderBuffer(long nextOffset, int bodySize) {
EpochEntry entry = AutoSwitchHAConnection.this.epochCache.getEntry(AutoSwitchHAConnection.this.currentTransferEpoch);
if (entry == null) {
LOGGER.error("Failed to find epochEntry with epoch {} when build msg header", AutoSwitchHAConnection.this.currentTransferEpoch);
// If broker is started on empty disk and no message entered (nextOffset = -1 and currentTransferEpoch = -1), do not output error log when sending heartbeat
if (nextOffset != -1 || currentTransferEpoch != -1 || bodySize > 0) {
LOGGER.error("Failed to find epochEntry with epoch {} when build msg header", AutoSwitchHAConnection.this.currentTransferEpoch);
}
if (bodySize > 0) {
return;
}