HDFS-17309. RBF: Fix Router Safemode check condition error (#6390) Contributed by liuguanghua.
Reviewed-by: Inigo Goiri <inigoiri@apache.org> Reviewed-by: Simbarashe Dzinamarira <sdzinamarira@linkedin.com> Signed-off-by: Shilun Fan <slfan1989@apache.org>
This commit is contained in:
parent
661c784662
commit
2369f0cddb
@ -169,7 +169,7 @@ public void periodicInvoke() {
|
|||||||
}
|
}
|
||||||
StateStoreService stateStore = router.getStateStore();
|
StateStoreService stateStore = router.getStateStore();
|
||||||
long cacheUpdateTime = stateStore.getCacheUpdateTime();
|
long cacheUpdateTime = stateStore.getCacheUpdateTime();
|
||||||
boolean isCacheStale = (now - cacheUpdateTime) > this.staleInterval;
|
boolean isCacheStale = (cacheUpdateTime == 0) || (now - cacheUpdateTime) > this.staleInterval;
|
||||||
|
|
||||||
// Always update to indicate our cache was updated
|
// Always update to indicate our cache was updated
|
||||||
if (isCacheStale) {
|
if (isCacheStale) {
|
||||||
|
@ -132,6 +132,8 @@ public StateStoreService() {
|
|||||||
// Caches to maintain
|
// Caches to maintain
|
||||||
this.cachesToUpdateInternal = new ArrayList<>();
|
this.cachesToUpdateInternal = new ArrayList<>();
|
||||||
this.cachesToUpdateExternal = new ArrayList<>();
|
this.cachesToUpdateExternal = new ArrayList<>();
|
||||||
|
|
||||||
|
this.cacheLastUpdateTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user