-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HBASE-27303 Unnecessary replication to secondary region replicas shou… #4707
Conversation
…ld avoid when WAL.sync throws Exception
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
* so there is no need to replicate to secondary replica, for this reason here we attach the | ||
* region replication action after the {@link HRegion#sync} is successful. | ||
*/ | ||
this.attachRegionReplicationInWALAppend(batchOp, miniBatchOp, walKey, walEdit, writeEntry); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For most cases the sync will succeeded, attach it before WAL sync can speed up the replication? No?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Apache9 , the replication is fired by MVCC.complete
, so seems that attaching it before WAL.sync
could not speed up the replication.By the previous discussion in HBASE-27223 and #4633, sync
may throws exception(especially for FSHLog, it has no retry and may throws any exception thrown by ProtobufLogWriter.append
or ProtobufLogWriter.sync
,and it may not abort the regionServer, HBASE-27231 try to solve this problem), attaching the region replication after sync success could try to avoid data inconsistent between primary and secondary replicas,and if WAL.sync
throws exception, we have no need to replicate to secondary region replicas whether RegionServer is aborted or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we will complete the MVCC entry after calling this method.
…ld avoid when WAL.sync throws Exception