[ https://issues.apache.org/jira/browse/HBASE-21406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670490#comment-16670490 ]
Wellington Chevreuil commented on HBASE-21406: ---------------------------------------------- Issue here is that ReplicationSink is always initialised as part of the replication services: !Screen Shot 2018-10-31 at 18.12.54.png! It's then kept by HRegionServer instance and only invoked once some RPC to replicateWalEntry method is invoked. It has the metrics, but it's not supposed to know if something should be replicating to it or not. One alternative here would be to change *MetricsReplicationSinkSource,* to track/expose specific timestamp attribute for the sink initialisation. That way, clients/UIs could use it to compare with timestampOfLastApplied and define if there's ever any OP shipped. Another interesting info to expose on status command output is the total amount of applied OPs (which is already tracked and showed via JMX). I will be proposing an initial patch with this approach later. > "status 'replication'" should not show SINK if the cluster does not act as > sink > ------------------------------------------------------------------------------- > > Key: HBASE-21406 > URL: https://issues.apache.org/jira/browse/HBASE-21406 > Project: HBase > Issue Type: Improvement > Reporter: Daisuke Kobayashi > Assignee: Wellington Chevreuil > Priority: Minor > Attachments: Screen Shot 2018-10-31 at 18.12.54.png > > > When replicating in 1 way, from source to target, {{status 'replication'}} on > source always dumps SINK with meaningless metrics. It only makes sense when > running the command on target cluster. > {{status 'replication'}} on source, for example. {{AgeOfLastAppliedOp}} is > always zero and {{TimeStampsOfLastAppliedOp}} does not get updated from the > time the RS started since it's not acting as sink. > {noformat} > source-1.com > SOURCE: PeerID=1, AgeOfLastShippedOp=0, SizeOfLogQueue=0, > TimeStampsOfLastShippedOp=Mon Oct 29 23:44:14 PDT 2018, Replication Lag=0 > SINK : AgeOfLastAppliedOp=0, TimeStampsOfLastAppliedOp=Thu Oct 25 > 23:56:53 PDT 2018 > {noformat} > {{status 'replication'}} on target works as expected. SOURCE is empty as it's > not acting as source: > {noformat} > target-1.com > SOURCE: > SINK : AgeOfLastAppliedOp=70, TimeStampsOfLastAppliedOp=Mon Oct 29 > 23:44:08 PDT 2018 > {noformat} > This is because {{getReplicationLoadSink}}, called in {{admin.rb}}, always > returns a value (not null). > 1.X > https://github.com/apache/hbase/blob/rel/1.4.0/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java#L194-L204 > 2.X > https://github.com/apache/hbase/blob/rel/2.0.0/hbase-client/src/main/java/org/apache/hadoop/hbase/ServerLoad.java#L392-L399 -- This message was sent by Atlassian JIRA (v7.6.3#76005)