You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/05/23 14:27:03 UTC
[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4355: [Summer of code] Shrink and expand InSyncStateSet
hzh0425 commented on code in PR #4355:
URL: https://github.com/apache/rocketmq/pull/4355#discussion_r879522362
##########
store/src/main/java/org/apache/rocketmq/store/ha/autoswitch/AutoSwitchHAConnection.java:
##########
@@ -279,12 +296,17 @@ protected boolean processReadResult(ByteBuffer byteBufferRead) {
long slaveMaxOffset = byteBufferRead.getLong(readPosition + 4);
ReadSocketService.this.processPosition += AutoSwitchHAClient.TRANSFER_HEADER_SIZE;
- slaveAckOffset = slaveMaxOffset;
+ AutoSwitchHAConnection.this.slaveAckOffset = slaveMaxOffset;
if (slaveRequestOffset < 0) {
slaveRequestOffset = slaveMaxOffset;
}
LOGGER.info("slave[" + clientAddress + "] request offset " + slaveMaxOffset);
byteBufferRead.position(readSocketPos);
+ if (slaveMaxOffset >= AutoSwitchHAConnection.this.lastMasterMaxOffset) {
+ AutoSwitchHAConnection.this.lastCatchUpTimeMs = Math.max(AutoSwitchHAConnection.this.lastTransferTimeMs, AutoSwitchHAConnection.this.lastCatchUpTimeMs);
+ AutoSwitchHAConnection.this.haService.maybeExpandInSyncStateSet(AutoSwitchHAConnection.this.slaveAddress, slaveMaxOffset);
+ }
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org