accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject git commit: ACCUMULO-3214 Clear zoocache and retry when fail to get table configuration
Date Tue, 14 Oct 2014 18:08:09 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master e2cb57823 -> 1f9630d4c


ACCUMULO-3214 Clear zoocache and retry when fail to get table configuration

Table could be created on a different server and the current server
didn't see watcher update yet. This ultimately makes the server think
that the given table doesn't exist (which creates a null config).


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/1f9630d4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/1f9630d4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/1f9630d4

Branch: refs/heads/master
Commit: 1f9630d4cb5e2bf757a694e274895607bf014e16
Parents: e2cb578
Author: Josh Elser <elserj@apache.org>
Authored: Wed Oct 8 19:40:10 2014 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Tue Oct 14 13:58:08 2014 -0400

----------------------------------------------------------------------
 .../org/apache/accumulo/tserver/tablet/Tablet.java  | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/1f9630d4/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 0194778..97902fe 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -46,6 +46,7 @@ import org.apache.accumulo.core.client.Durability;
 import org.apache.accumulo.core.client.IteratorSetting;
 import org.apache.accumulo.core.client.impl.DurabilityImpl;
 import org.apache.accumulo.core.client.impl.ScannerImpl;
+import org.apache.accumulo.core.client.impl.Tables;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.ConfigurationCopy;
 import org.apache.accumulo.core.conf.ConfigurationObserver;
@@ -464,8 +465,20 @@ public class Tablet implements TabletCommitter {
       final List<LogEntry> rawLogEntries, final SortedMap<FileRef,DataFileValue>
rawDatafiles, String time, final TServerInstance lastLocation,
       Set<FileRef> scanFiles, long initFlushID, long initCompactID) throws IOException
{
 
+    TableConfiguration tblConf = tabletServer.getTableConfiguration(extent);
+    if (null == tblConf) {
+      Tables.clearCache(tabletServer.getInstance());
+      tblConf = tabletServer.getTableConfiguration(extent);
+      if (null == tblConf) {
+        // Not guaranteed to be non-null, but should be. A failed load will be re-assigned
though..
+        log.warn("Could not get table configuration for " + extent.getTableId().toString());
+      }
+    }
+
+    this.tableConfiguration = tblConf;
+
     TabletFiles tabletPaths = VolumeUtil.updateTabletVolumes(tabletServer.getLock(), tabletServer.getFileSystem(),
extent, new TabletFiles(location.toString(),
-        rawLogEntries, rawDatafiles), ReplicationConfigurationUtil.isEnabled(extent, tabletServer.getTableConfiguration(extent)));
+        rawLogEntries, rawDatafiles), ReplicationConfigurationUtil.isEnabled(extent, this.tableConfiguration));
 
     Path locationPath;
 
@@ -481,7 +494,6 @@ public class Tablet implements TabletCommitter {
     this.location = locationPath;
     this.lastLocation = lastLocation;
     this.tabletDirectory = tabletPaths.dir;
-    this.tableConfiguration = tabletServer.getTableConfiguration(extent);
 
     this.extent = extent;
     this.tabletResources = trm;


Mime
View raw message