Apache9 commented on a change in pull request #2392:
URL: https://github.com/apache/hbase/pull/2392#discussion_r491347839



##########
File path: 
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MetaLocationCache.java
##########
@@ -102,34 +111,43 @@
       master.getConfiguration().getInt(SYNC_INTERVAL_SECONDS, 
DEFAULT_SYNC_INTERVAL_SECONDS);
     int fetchTimeoutMs =
       master.getConfiguration().getInt(FETCH_TIMEOUT_MS, 
DEFAULT_FETCH_TIMEOUT_MS);
-    master.getChoreService().scheduleChore(new ScheduledChore(
-      getClass().getSimpleName() + "-Sync-Chore", this, syncIntervalSeconds, 
0, TimeUnit.SECONDS) {
+    refreshChore = new ScheduledChore(getClass().getSimpleName() + 
"-Sync-Chore", this,
+      syncIntervalSeconds, 0, TimeUnit.SECONDS) {
 
       @Override
       protected void chore() {
         AsyncClusterConnection conn = master.getAsyncClusterConnection();
         if (conn != null) {
-          addListener(conn.getAllMetaRegionLocations(fetchTimeoutMs), (locs, 
error) -> {
+          final CacheHolder ch = holder.get();
+          long lastSyncSeqId = ch != null ? ch.lastSyncSeqId : 
HConstants.NO_SEQNUM;
+          addListener(conn.syncRoot(lastSyncSeqId, fetchTimeoutMs), (resp, 
error) -> {

Review comment:
       The key change is the syncRoot method. The getAllMetaRegionLocations 
method is also used at client side, so it is not suitable to add parameters 
which are not useful for client.
   The point here is that, we should test the MVCC number of the catalog family 
when syncing root, if there is no change, then we do not need to recreate the 
meta cache.
   And there is a follow on issue to fan out the edits to catalog family to 
backup masters.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to