HBASE-11617 incorrect AgeOfLastAppliedOp and AgeOfLastShippedOp in replication Metrics when no new replication OP (Demai Ni)
This commit is contained in:
parent
6aba7cf40e
commit
4ba7f67f80
|
@ -47,8 +47,11 @@ public class MetricsSink {
|
|||
* @return the age that was set
|
||||
*/
|
||||
public long setAgeOfLastAppliedOp(long timestamp) {
|
||||
lastTimestampForAge = timestamp;
|
||||
long age = System.currentTimeMillis() - lastTimestampForAge;
|
||||
long age = 0;
|
||||
if (lastTimestampForAge != timestamp) {
|
||||
lastTimestampForAge = timestamp;
|
||||
age = System.currentTimeMillis() - lastTimestampForAge;
|
||||
}
|
||||
rms.setGauge(SINK_AGE_OF_LAST_APPLIED_OP, age);
|
||||
return age;
|
||||
}
|
||||
|
|
|
@ -393,6 +393,9 @@ public class ReplicationSource extends Thread
|
|||
// Reset the sleep multiplier if nothing has actually gone wrong
|
||||
if (!gotIOE) {
|
||||
sleepMultiplier = 1;
|
||||
// if there was nothing to ship and it's not an error
|
||||
// set "ageOfLastShippedOp" to <now> to indicate that we're current
|
||||
this.metrics.setAgeOfLastShippedOp(System.currentTimeMillis());
|
||||
}
|
||||
if (sleepForRetries("Nothing to replicate", sleepMultiplier)) {
|
||||
sleepMultiplier++;
|
||||
|
|
Loading…
Reference in New Issue