ankitsol commented on code in PR #7617:
URL: https://github.com/apache/hbase/pull/7617#discussion_r2736314130
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceShipper.java:
##########
@@ -229,6 +247,41 @@ private void shipEdits(WALEntryBatch entryBatch) {
}
}
+ private boolean shouldPersistLogPosition() {
+ ReplicationEndpoint endpoint = source.getReplicationEndpoint();
+ long maxBufferSize = endpoint.getMaxBufferSize();
+ if (stagedWalSize == 0 || lastShippedBatch == null) {
+ return false;
+ }
+ if (maxBufferSize == -1) {
+ return true;
+ }
+ return stagedWalSize >= maxBufferSize
+ || (EnvironmentEdgeManager.currentTime() - lastStagedFlushTs >=
endpoint.maxFlushInterval());
+ }
+
+ private void persistLogPosition() throws IOException {
+ if (lastShippedBatch == null) {
Review Comment:
As far as I understand, lastShippedBatch 'null' means no batch has been
replicated yet, so we don't need to update offset. Please correct me if I am
wrong here
lastShippedBatch is by default 'null' during ReplicationSourceShipper
initialisation and as soon as a batch is replicated it is updated.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]