You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Demai Ni <ni...@gmail.com> on 2013/10/18 03:58:43 UTC

Re: [Question: Replication] how to detect whether there is a replication pending?

hi, J-D and all,

still the same question. I thought I fix it before, while I was wrong.

in ReplicationSource, I used this code:
    float opsRate = this.metrics.shippedOpsRate.getPreviousIntervalValue();
    float batchRate =
this.metrics.shippedBatchesRate.getPreviousIntervalValue();
    float logFilteredRate =
this.metrics.logEditsFilteredRate.getPreviousIntervalValue();
    float logEditsReadRate =
this.metrics.logEditsReadRate.getPreviousIntervalValue();

but above values are already 0.0, even the logs shows some Edits are being
pushed over.

a bit background about what I am doing as the original question was asked a
month ago:

"(hbase 0.94.9) I am looking for a way to flag that NO replication is
pending. For example of a simple Master-Slave setup for table t1. At a
given point of time, can I tell whether there are still Edits pending for
replication?  checking the sizeOfLogQueue won't work ash
metrics.sizeOfLogQueue=0, there may still has one Log being processed for
replication with worse case of 64MB pending.  Hopefully the method will
works even when sink is offline"

many  thanks for your suggestions

Demai




On Wed, Sep 18, 2013 at 10:38 AM, Jean-Daniel Cryans <jd...@apache.org>wrote:

> Yeah, with HLog queue you can be a whole 64MB in the worst case :)
>
> Pretty hard to say for a single table what the status is, but if it was
> cluster-wide you'd just have to look at the shipped ops/batch rates (if it
> sits at 0, you're not replicating, unless there's some problem preventing
> replication).
>
> J-D
>
>
> On Wed, Sep 18, 2013 at 9:33 AM, Demai Ni <ni...@gmail.com> wrote:
>
> > hi, folks,
> >
> > I am looking for a way to flag that NO replication is pending. For
> example
> > of a simple Master-Slave setup for table t1. At a given point of time,
> can
> > I tell whether there are still Edits pending for replication? I am
> thinking
> > about using replicationsource.metrics.sizeOfLogQueue. The only concern is
> > that even with metrics.sizeOfLogQueue=0, there may still has one Log
> being
> > processed for replication. Is my understanding correct?
> >
> > Thanks
> >
> > Demai
> >
>