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-24998 Introduce a ReplicationSourceController interface … #2364
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -979,6 +979,8 @@ | |||
/* | |||
* cluster replication constants. | |||
*/ | |||
public static final String REPLICATION_OFFLOAD_ENABLE_KEY = "hbase.replication.offload.enabled"; | |||
public static final boolean REPLICATION_OFFLOAD_ENABLE_DEFAULT = false; |
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.
Only used in ReplicationSourceManager so define these there?
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.
In the next patches, this may be used in other place, too.
@@ -0,0 +1,31 @@ | |||
package org.apache.hadoop.hbase.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.
License
* Used by {@link ReplicationSource} or {@link RecoveredReplicationSource}. | ||
*/ | ||
@InterfaceAudience.Private | ||
public interface ReplicationSourceOverallController { |
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.
Can it just be ReplicationSoruceController? Drop the 'Overall'?
* Returns the maximum size in bytes of edits held in memory which are pending replication | ||
* across all sources inside this RegionServer or ReplicationServer. | ||
*/ | ||
long getTotalBufferLimit(); |
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.
Is this a 'size' rather than a 'limit'? It is count of how many bytes are currently accumulated in replication source memory?
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.
Maybe the comment is just in the wrong place.. should be on the next data member?
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 was copied from the ReplicationSourceManager. And it is the total limit, not the currently size.
|
||
AtomicLong getTotalBufferUsed(); | ||
|
||
MetricsReplicationGlobalSourceSource getGlobalMetrics(); |
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.
What sort of 'global' metrics? This is metrics for all replication sources?
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.
Yes.
this.totalBufferLimit = conf.getLong(HConstants.REPLICATION_SOURCE_TOTAL_BUFFER_KEY, | ||
HConstants.REPLICATION_SOURCE_TOTAL_BUFFER_DFAULT); | ||
this.globalMetrics = globalMetrics; | ||
this.replicationOffload = conf.getBoolean(HConstants.REPLICATION_OFFLOAD_ENABLE_KEY, |
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.
I should go back to the design but we can't just have the offload be a ReplicationSource implementation? Because you need to span all ReplicationSources?
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.
In the design, the RegionServer not need to start all ReplicationSources. It only need to store its WAL path to the ReplicationQueueStorage. And the ReplicationServer will fetch the WAL paths and start all ReplicationSources.
@@ -244,7 +286,7 @@ private void adoptAbandonedQueues() { | |||
* </ol> | |||
* @param peerId the id of replication peer | |||
*/ | |||
public void addPeer(String peerId) throws IOException { | |||
void addPeer(String peerId) throws IOException { |
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.
Funny, I want it to stay public in my current work (meta region replicas). Can move it back in my patch.
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.
I want to call it on Region open. Let me see if I can move where I make the call.
@@ -268,7 +310,7 @@ public void addPeer(String peerId) throws IOException { | |||
* </ol> | |||
* @param peerId the id of the replication peer | |||
*/ | |||
public void removePeer(String peerId) { | |||
void removePeer(String peerId) { |
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.
Ditto
...src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
Show resolved
Hide resolved
@@ -267,10 +267,11 @@ public Path getCurrentPath() { | |||
//returns false if we've already exceeded the global quota | |||
private boolean checkQuota() { | |||
// try not to go over total quota | |||
if (source.manager.getTotalBufferUsed().get() > source.manager.getTotalBufferLimit()) { | |||
if (source.overallController.getTotalBufferUsed().get() > source.overallController |
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.
Yeah, if the Controller is in the ReplicationSourceManager, then the 'overall' will be redundant?
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
99503d1
to
ac62e96
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
…and decouple ReplicationSourceManager and ReplicationSource
ac62e96
to
069ed71
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Ping @saintstack . Any other concerns? |
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource (#2364) Signed-off-by: meiyi <myimeiyi@gmail.com>
…and decouple ReplicationSourceManager and ReplicationSource