You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2015/05/07 07:15:52 UTC
[1/3] accumulo git commit: ACCUMULO-3772 All ZK WAL refs contain
LogEntry in the node.
Repository: accumulo
Updated Branches:
refs/heads/1.7 f8303008c -> f55751bc0
refs/heads/master 5b7a14eb5 -> 134300382
ACCUMULO-3772 All ZK WAL refs contain LogEntry in the node.
As bad as having two nodes for tracking WAL for the root
tablet, the data of current_logs and walogs in ZK varied.
Make them all the same value for consistency
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f55751bc
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f55751bc
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f55751bc
Branch: refs/heads/1.7
Commit: f55751bc073d449099794fd4fc5cc7a3ce7ee388
Parents: f830300
Author: Josh Elser <el...@apache.org>
Authored: Thu May 7 00:20:26 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu May 7 00:42:37 2015 -0400
----------------------------------------------------------------------
.../apache/accumulo/server/util/MetadataTableUtil.java | 13 +++++++++++--
.../apache/accumulo/test/functional/WALSunnyDayIT.java | 4 +++-
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/f55751bc/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 4470c55..c85cee7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -1056,6 +1056,13 @@ public class MetadataTableUtil {
public static void addNewLogMarker(ClientContext context, ZooLock zooLock, final TServerInstance tabletSession, final Path filename, TabletLevel level) {
log.debug("Adding log entry " + filename);
if (level == TabletLevel.ROOT) {
+ LogEntry log = new LogEntry(RootTable.EXTENT, System.currentTimeMillis(), tabletSession.hostPort(), filename.toString());
+ final byte[] node;
+ try {
+ node = log.toBytes();
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to write to byte array", e);
+ }
retryZooKeeperUpdate(context, zooLock, new ZooOperation() {
@Override
public void run(IZooReaderWriter rw) throws KeeperException, InterruptedException, IOException {
@@ -1066,7 +1073,7 @@ public class MetadataTableUtil {
path.append(CurrentLogsSection.getRowPrefix());
path.append(tabletSession.toString());
path.append(uniqueId);
- rw.putPersistentData(path.toString(), filename.toString().getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
+ rw.putPersistentData(path.toString(), node, NodeExistsPolicy.OVERWRITE);
}
});
} else {
@@ -1153,7 +1160,9 @@ public class MetadataTableUtil {
String root = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + RootTable.ZROOT_TABLET_CURRENT_LOGS;
logs.clear();
for (String child : rw.getChildren(root)) {
- logs.add(new Path(new String(rw.getData(root + "/" + child, null), UTF_8)));
+ byte[] data = rw.getData(root + "/" + child, null);
+ LogEntry entry = LogEntry.fromBytes(data);
+ logs.add(new Path(entry.filename));
}
}
});
http://git-wip-us.apache.org/repos/asf/accumulo/blob/f55751bc/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
index 9f22466..74c79a1 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
@@ -48,6 +48,7 @@ import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.CurrentLogsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
+import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.master.state.SetGoalState;
@@ -213,7 +214,8 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
List<String> children = zoo.getChildren(zpath, null);
for (String child : children) {
byte[] data = zoo.getData(zpath + "/" + child, null, null);
- result.put(new String(data), true);
+ LogEntry entry = LogEntry.fromBytes(data);
+ result.put(entry.filename, true);
}
return result;
}
[3/3] accumulo git commit: Merge branch '1.7'
Posted by el...@apache.org.
Merge branch '1.7'
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/13430038
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/13430038
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/13430038
Branch: refs/heads/master
Commit: 13430038283a04714c47213f5d866d1211a6a279
Parents: 5b7a14e f55751b
Author: Josh Elser <el...@apache.org>
Authored: Thu May 7 01:15:42 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu May 7 01:15:42 2015 -0400
----------------------------------------------------------------------
.../apache/accumulo/server/util/MetadataTableUtil.java | 13 +++++++++++--
.../apache/accumulo/test/functional/WALSunnyDayIT.java | 4 +++-
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/13430038/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
[2/3] accumulo git commit: ACCUMULO-3772 All ZK WAL refs contain
LogEntry in the node.
Posted by el...@apache.org.
ACCUMULO-3772 All ZK WAL refs contain LogEntry in the node.
As bad as having two nodes for tracking WAL for the root
tablet, the data of current_logs and walogs in ZK varied.
Make them all the same value for consistency
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/f55751bc
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/f55751bc
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/f55751bc
Branch: refs/heads/master
Commit: f55751bc073d449099794fd4fc5cc7a3ce7ee388
Parents: f830300
Author: Josh Elser <el...@apache.org>
Authored: Thu May 7 00:20:26 2015 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Thu May 7 00:42:37 2015 -0400
----------------------------------------------------------------------
.../apache/accumulo/server/util/MetadataTableUtil.java | 13 +++++++++++--
.../apache/accumulo/test/functional/WALSunnyDayIT.java | 4 +++-
2 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/f55751bc/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index 4470c55..c85cee7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -1056,6 +1056,13 @@ public class MetadataTableUtil {
public static void addNewLogMarker(ClientContext context, ZooLock zooLock, final TServerInstance tabletSession, final Path filename, TabletLevel level) {
log.debug("Adding log entry " + filename);
if (level == TabletLevel.ROOT) {
+ LogEntry log = new LogEntry(RootTable.EXTENT, System.currentTimeMillis(), tabletSession.hostPort(), filename.toString());
+ final byte[] node;
+ try {
+ node = log.toBytes();
+ } catch (IOException e) {
+ throw new RuntimeException("Failed to write to byte array", e);
+ }
retryZooKeeperUpdate(context, zooLock, new ZooOperation() {
@Override
public void run(IZooReaderWriter rw) throws KeeperException, InterruptedException, IOException {
@@ -1066,7 +1073,7 @@ public class MetadataTableUtil {
path.append(CurrentLogsSection.getRowPrefix());
path.append(tabletSession.toString());
path.append(uniqueId);
- rw.putPersistentData(path.toString(), filename.toString().getBytes(UTF_8), NodeExistsPolicy.OVERWRITE);
+ rw.putPersistentData(path.toString(), node, NodeExistsPolicy.OVERWRITE);
}
});
} else {
@@ -1153,7 +1160,9 @@ public class MetadataTableUtil {
String root = ZooUtil.getRoot(HdfsZooInstance.getInstance()) + RootTable.ZROOT_TABLET_CURRENT_LOGS;
logs.clear();
for (String child : rw.getChildren(root)) {
- logs.add(new Path(new String(rw.getData(root + "/" + child, null), UTF_8)));
+ byte[] data = rw.getData(root + "/" + child, null);
+ LogEntry entry = LogEntry.fromBytes(data);
+ logs.add(new Path(entry.filename));
}
}
});
http://git-wip-us.apache.org/repos/asf/accumulo/blob/f55751bc/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
index 9f22466..74c79a1 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/WALSunnyDayIT.java
@@ -48,6 +48,7 @@ import org.apache.accumulo.core.metadata.RootTable;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.CurrentLogsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection;
import org.apache.accumulo.core.metadata.schema.MetadataSchema.TabletsSection.TabletColumnFamily;
+import org.apache.accumulo.core.tabletserver.log.LogEntry;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.master.state.SetGoalState;
@@ -213,7 +214,8 @@ public class WALSunnyDayIT extends ConfigurableMacIT {
List<String> children = zoo.getChildren(zpath, null);
for (String child : children) {
byte[] data = zoo.getData(zpath + "/" + child, null, null);
- result.put(new String(data), true);
+ LogEntry entry = LogEntry.fromBytes(data);
+ result.put(entry.filename, true);
}
return result;
}