-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26406 Can not add peer replicating to non-HBase #3806
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
Conversation
|
🎊 +1 overall
This message was automatically generated. |
shahrs87
left a comment
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.
Overall looks good to me, just couple of questions.
| public static final HBaseClassTestRule CLASS_RULE = | ||
| HBaseClassTestRule.forClass(TestNonHBaseReplicationEndpoint.class); | ||
|
|
||
| private static final Logger LOG = LoggerFactory.getLogger(TestNonHBaseReplicationEndpoint.class); |
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.
nit: LOG not used anywhere.
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, I'll remove the LOG
| // Default is HBaseInterClusterReplicationEndpoint and only it need to check cluster key | ||
| if (endpoint == null || endpoint instanceof HBaseInterClusterReplicationEndpoint) { | ||
| // Endpoints implementing HBaseReplicationEndpoint need to check cluster key | ||
| if (endpoint == null || endpoint instanceof HBaseReplicationEndpoint) { |
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.
As for this issue, it doesn't matter whether it is an instance of HBaseInterClusterReplicationEndpoint or HBaseReplicationEndpoint, correct ? since the test is skipping the check completely.
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.
The reason I modified here is that the target of HBaseReplicationEndpoint is an HBase cluster, for all its implementations including HBaseInterClusterReplicationEndpoint, we should check clusterKey.
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.
Sound reasonable.
| } | ||
|
|
||
| private void checkClusterId(String clusterKey) throws DoNotRetryIOException { | ||
| private void checkSameClusterKey(String clusterKey) throws DoNotRetryIOException { |
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.
This method is checking whether cluster id is same or not, so IMO the method name is correct. We can change it to checkSameClusterId if you like.
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.
The original method name checkClusterId is inappropriate, clusterId and clusterKey are not the same thing in replication, So I kept the same style as the above method checkClusterKey and renamed it checkSameClusterKey.
| } | ||
| } | ||
|
|
||
| public static class NonHBaseReplicationEndpoint extends BaseReplicationEndpoint { |
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.
Just curious, BaseReplicationEndpoint's InterfaceAudience is Private and so is HBaseInterClusterReplicationEndpoint and HBaseReplicationEndpoint's IA. If anyone wants to implement its custom ReplicationEndPoint, should we think to make it LimitedPrivate with HBaseInterfaceAudience as REPLICATION.
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.
The answer should be in HBASE-15982, made HBaseReplicationEndpoint and BaseReplicationEndpoint as Private since want to internalize Guava's API, so custom Endpoint should implement ReplicationEndpoint.
I was not aware of this problem before, I should make NonHBaseReplicationEndpoint implement ReplicationEndpoint.
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
| // Default is HBaseInterClusterReplicationEndpoint and only it need to check cluster key | ||
| if (endpoint == null || endpoint instanceof HBaseInterClusterReplicationEndpoint) { | ||
| // Endpoints implementing HBaseReplicationEndpoint need to check cluster key | ||
| if (endpoint == null || endpoint instanceof HBaseReplicationEndpoint) { |
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.
Sound reasonable.
|
Please fix the checkstyle issue before merging. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
shahrs87
left a comment
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.
Thank you @ddupg ! ltgm
|
🎊 +1 overall
This message was automatically generated. |
|
💔 -1 overall
This message was automatically generated. |
Signed-off-by: Rushabh Shah <[email protected]> Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit b9b7fec)
Signed-off-by: Rushabh Shah <[email protected]> Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit b9b7fec)
Signed-off-by: Rushabh Shah <[email protected]> Signed-off-by: Duo Zhang <[email protected]> (cherry picked from commit b9b7fec)
Failed to add a peer replicating to non-HBase(like MQ) by implementing custom ReplicationEndpoint, got exception like this in my UT:
HBASE-24743 ignored this situation and introduced this bug.