Repository: accumulo Updated Branches: refs/heads/1.7 1d5cd1157 -> b70b52810 refs/heads/1.8 c12679ad4 -> 757dedf7a refs/heads/master a01c75698 -> ad6e98112
ACCUMULO-4368 Offline and online the table when constraints are altered There is a known race condition that can cause inconsistencies for Constraints to loaded by tabletservers which make it extremely difficult to write tests. Offline'ing the table should force the tabletserver to reread the zookeeper configuration when the tablets are brought back online Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b70b5281 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b70b5281 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b70b5281 Branch: refs/heads/1.7 Commit: b70b528104a0d3e4445f3d2f2dd01fc6e4a9f5c0 Parents: 1d5cd11 Author: Josh Elser <els...@apache.org> Authored: Mon Jul 11 14:29:54 2016 -0400 Committer: Josh Elser <els...@apache.org> Committed: Mon Jul 11 14:29:54 2016 -0400 ---------------------------------------------------------------------- .../accumulo/test/proxy/SimpleProxyBase.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/b70b5281/test/src/test/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java b/test/src/test/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java index bf757ad..a419e43 100644 --- a/test/src/test/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java +++ b/test/src/test/java/org/apache/accumulo/test/proxy/SimpleProxyBase.java @@ -1367,6 +1367,10 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { // zookeeper propagation time UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME); + // Take the table offline and online to force a config update + client.offlineTable(creds, table, true); + client.onlineTable(creds, table, true); + WriterOptions writerOptions = new WriterOptions(); writerOptions.setLatencyMs(10000); writerOptions.setMaxMemory(2); @@ -1407,6 +1411,10 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { client.removeConstraint(creds, table, 2); + // Take the table offline and online to force a config update + client.offlineTable(creds, table, true); + client.onlineTable(creds, table, true); + constraints = client.listConstraints(creds, table); while (constraints.containsKey(NumericValueConstraint.class.getName())) { log.info("Constraints still contains NumericValueConstraint"); @@ -1459,6 +1467,10 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { // zookeeper propagation time Thread.sleep(ZOOKEEPER_PROPAGATION_TIME); + // Take the table offline and online to force a config update + client.offlineTable(creds, table, true); + client.onlineTable(creds, table, true); + log.debug("Attempting to verify client-side that constraints are observed"); Map<String,Integer> constraints = client.listConstraints(creds, table); @@ -1493,6 +1505,10 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { log.debug("Removing constraint from table"); client.removeConstraint(creds, table, 2); + // Take the table offline and online to force a config update + client.offlineTable(creds, table, true); + client.onlineTable(creds, table, true); + UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME); constraints = client.listConstraints(creds, table); @@ -1827,6 +1843,10 @@ public abstract class SimpleProxyBase extends SharedMiniClusterIT { client.addConstraint(creds, table, NumericValueConstraint.class.getName()); UtilWaitThread.sleep(ZOOKEEPER_PROPAGATION_TIME); + // Take the table offline and online to force a config update + client.offlineTable(creds, table, true); + client.onlineTable(creds, table, true); + while (!client.listConstraints(creds, table).containsKey(NumericValueConstraint.class.getName())) { log.info("Failed to see constraint"); Thread.sleep(1000);