Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixes to rebalancing tests

-- Fix bdb misconfig to speed up ~10x
-- Disable the BlockingIO testing
  • Loading branch information...
commit 93c9161b1c9da3924a1d37c846cc31ce455b22a2 1 parent e7022bc
@vinothchandar vinothchandar authored
View
2  contrib/ec2-testing/test/voldemort/utils/Ec2RebalanceTest.java
@@ -70,7 +70,7 @@
private List<String> activeHostNames = new ArrayList<String>();
public Ec2RebalanceTest() {
- super(true);
+ super();
}
@BeforeClass
View
2  test/common/voldemort/ServerTestUtils.java
@@ -793,8 +793,6 @@ public static VoldemortConfig createServerConfig(boolean useNio,
props.put("node.id", nodeId);
props.put("voldemort.home", baseDir + "/node-" + nodeId);
props.put("bdb.cache.size", 1 * 1024 * 1024);
- props.put("bdb.write.transactions", "true");
- props.put("bdb.flush.transactions", "true");
props.put("jmx.enable", "false");
props.put("enable.mysql.engine", "true");
props.loadProperties(properties);
View
20 test/long/voldemort/client/rebalance/NonZonedRebalanceLongTest.java
@@ -16,33 +16,17 @@
package voldemort.client.rebalance;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
/**
* Run a version of RebalanceTests with a lot more keys.
*
*/
-@RunWith(Parameterized.class)
public class NonZonedRebalanceLongTest extends AbstractNonZonedRebalanceTest {
private final int NUM_KEYS = 10100;
- public NonZonedRebalanceLongTest(boolean useNio) {
- super(useNio);
- }
-
- @Parameters
- public static Collection<Object[]> configs() {
- /*-
- return Arrays.asList(new Object[][] { { true, true }, { true, false }, { false, true },
- { false, false } });
- */
- return Arrays.asList(new Object[][] { { true }, { false } });
+ public NonZonedRebalanceLongTest() {
+ super();
}
@Override
View
19 test/long/voldemort/client/rebalance/ZonedRebalanceLongTest.java
@@ -16,32 +16,17 @@
package voldemort.client.rebalance;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
/**
* Run a version of RebalanceTests with a lot more keys.
*
*/
-@RunWith(Parameterized.class)
public class ZonedRebalanceLongTest extends AbstractZonedRebalanceTest {
private final int NUM_KEYS = 10100;
- public ZonedRebalanceLongTest(boolean useNio) {
- super(useNio);
- }
- @Parameters
- public static Collection<Object[]> configs() {
- /*-
- return Arrays.asList(new Object[][] { { true, true }, { true, false }, { false, true },
- { false, false } });
- */
- return Arrays.asList(new Object[][] { { true }, { false } });
+ public ZonedRebalanceLongTest() {
+ super();
}
@Override
View
46 test/unit/voldemort/client/rebalance/AbstractNonZonedRebalanceTest.java
@@ -108,8 +108,8 @@
private StoreDefinition rwStoreDefWithReplication;
private StoreDefinition rwStoreDefWithReplication2;
- public AbstractNonZonedRebalanceTest(boolean useNio) {
- super(useNio);
+ public AbstractNonZonedRebalanceTest() {
+ super();
}
@Before
@@ -227,8 +227,8 @@ public void testRORWRebalance() throws Exception {
{ 0, 1, 2, 3, 4, 5, 6, 7, 8 }, {} });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2, 3));
+ 1,
+ Lists.newArrayList(2, 3));
// start servers 0 , 1 only
List<Integer> serverList = Arrays.asList(0, 1);
@@ -240,7 +240,7 @@ public void testRORWRebalance() throws Exception {
configProps);
String bootstrapUrl = getBootstrapUrl(currentCluster, 0);
-
+
final ClusterTestUtils.RebalanceKit rebalanceKit = ClusterTestUtils.getRebalanceKit(bootstrapUrl,
finalCluster);
@@ -278,8 +278,8 @@ public void testRORWRebalanceWithReplication() throws Exception {
{ 0, 1, 2, 3, 4, 5, 6 }, { 7, 8 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2, 3));
+ 1,
+ Lists.newArrayList(2, 3));
// start servers 0 , 1 only
List<Integer> serverList = Arrays.asList(0, 1);
@@ -328,8 +328,8 @@ public void testRORebalanceWithReplication() throws Exception {
{ 0, 1, 2, 3, 4, 5, 6 }, { 7, 8 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2, 3));
+ 1,
+ Lists.newArrayList(2, 3));
// start servers 0 , 1 only
List<Integer> serverList = Arrays.asList(0, 1);
@@ -381,8 +381,8 @@ public void testRWRebalanceWithReplication() throws Exception {
Cluster currentCluster = ServerTestUtils.getLocalCluster(2, new int[][] {
{ 0, 1, 2, 3, 4, 5, 6 }, { 7, 8 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2, 3));
+ 1,
+ Lists.newArrayList(2, 3));
// start servers 0 , 1 only
List<Integer> serverList = Arrays.asList(0, 1);
currentCluster = startServers(currentCluster,
@@ -421,8 +421,8 @@ public void testRebalanceCleanPrimary() throws Exception {
{ 1, 3 }, { 2 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 2,
- Lists.newArrayList(3));
+ 2,
+ Lists.newArrayList(3));
// start servers 0 , 1, 2
Map<String, String> configProps = new HashMap<String, String>();
@@ -487,8 +487,8 @@ public void testRebalanceCleanSecondary() throws Exception {
{ 1 }, { 2 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 2,
- Lists.newArrayList(3));
+ 2,
+ Lists.newArrayList(3));
// start servers 0 , 1, 2
Map<String, String> configProps = new HashMap<String, String>();
@@ -671,9 +671,9 @@ public void testProxyGetDuringRebalancing() throws Exception {
{ 0, 1, 2, 3, 4, 5, 6 }, { 7, 8 } });
final Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2,
- 3));
+ 1,
+ Lists.newArrayList(2,
+ 3));
// start servers 0 , 1 only
final List<Integer> serverList = Arrays.asList(0, 1);
Map<String, String> configProps = new HashMap<String, String>();
@@ -823,8 +823,8 @@ public void testProxyPutDuringRebalancing() throws Exception {
{ 1, 3 }, { 2 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 2,
- Lists.newArrayList(3));
+ 2,
+ Lists.newArrayList(3));
// start servers 0,1,2 only
final List<Integer> serverList = Arrays.asList(0, 1, 2);
@@ -1034,9 +1034,9 @@ public void testServerSideRouting() throws Exception {
{ 0, 1, 2, 3, 4, 5, 6 }, { 7, 8 } });
final Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 1,
- Lists.newArrayList(2,
- 3));
+ 1,
+ Lists.newArrayList(2,
+ 3));
final List<Integer> serverList = Arrays.asList(0, 1);
Map<String, String> configProps = new HashMap<String, String>();
View
21 test/unit/voldemort/client/rebalance/AbstractRebalanceTest.java
@@ -57,16 +57,13 @@
public abstract class AbstractRebalanceTest {
Map<Integer, VoldemortServer> serverMap;
-
- protected final boolean useNio;
HashMap<String, String> testEntries;
protected SocketStoreFactory socketStoreFactory;
- public AbstractRebalanceTest(boolean useNio) {
- this.useNio = useNio;
+ public AbstractRebalanceTest() {
this.serverMap = new HashMap<Integer, VoldemortServer>();
testEntries = ServerTestUtils.createRandomKeyValueString(getNumKeys());
- socketStoreFactory = new ClientRequestExecutorPool(2, 10000, 100000, 32 * 1024);
+ socketStoreFactory = new ClientRequestExecutorPool(2, 1000, 1000, 32 * 1024);
}
// This method is susceptible to BindException issues due to TOCTOU
@@ -87,8 +84,10 @@ protected Cluster startServers(Cluster cluster,
}
// turn proxy puts on
properties.put("proxy.puts.during.rebalance", "true");
+ properties.put("bdb.cache.size", "" + (5 * 1024 * 1024));
+ properties.put("bdb.one.env.per.store", "true");
- VoldemortConfig config = ServerTestUtils.createServerConfig(useNio,
+ VoldemortConfig config = ServerTestUtils.createServerConfig(true,
node,
TestUtils.createTempDir()
.getAbsolutePath(),
@@ -208,18 +207,18 @@ protected void checkEntriesPostRebalance(Cluster currentCluster,
HashMap<String, VectorClock> baselineVersions) {
for(StoreDefinition storeDef: storeDefs) {
Map<Integer, Set<Pair<Integer, Integer>>> currentNodeToPartitionTuples = ROTestUtils.getNodeIdToAllPartitions(currentCluster,
- storeDef,
- true);
+ storeDef,
+ true);
Map<Integer, Set<Pair<Integer, Integer>>> finalNodeToPartitionTuples = ROTestUtils.getNodeIdToAllPartitions(finalCluster,
- storeDef,
- true);
+ storeDef,
+ true);
for(int nodeId: nodeCheckList) {
Set<Pair<Integer, Integer>> currentPartitionTuples = currentNodeToPartitionTuples.get(nodeId);
Set<Pair<Integer, Integer>> finalPartitionTuples = finalNodeToPartitionTuples.get(nodeId);
HashMap<Integer, List<Integer>> flattenedPresentTuples = ROTestUtils.flattenPartitionTuples(Utils.getAddedInTarget(currentPartitionTuples,
- finalPartitionTuples));
+ finalPartitionTuples));
Store<ByteArray, byte[], byte[]> store = getSocketStore(storeDef.getName(),
finalCluster.getNodeById(nodeId)
.getHost(),
View
50 test/unit/voldemort/client/rebalance/AbstractZonedRebalanceTest.java
@@ -116,8 +116,8 @@
private StoreDefinition rwStoreDefWithReplication;
private StoreDefinition rwStoreDefWithReplication2;
- public AbstractZonedRebalanceTest(boolean useNio) {
- super(useNio);
+ public AbstractZonedRebalanceTest() {
+ super();
}
@Before
@@ -345,7 +345,7 @@ public void testShuffleZZAndShuffleAgain() throws Exception {
}
String bootstrapUrl = getBootstrapUrl(interimCluster, 0);
-
+
// Shuffle cluster
ClusterTestUtils.RebalanceKit rebalanceKit = ClusterTestUtils.getRebalanceKit(bootstrapUrl,
zzShuffle,
@@ -355,9 +355,7 @@ public void testShuffleZZAndShuffleAgain() throws Exception {
// Now, go from shuffled state, back to the original to ocnfirm
// subsequent rebalances can be invoked.
- rebalanceKit = ClusterTestUtils.getRebalanceKit(bootstrapUrl,
- zzCurrent,
- zzStores);
+ rebalanceKit = ClusterTestUtils.getRebalanceKit(bootstrapUrl, zzCurrent, zzStores);
rebalanceAndCheck(rebalanceKit.plan, rebalanceKit.controller, serverList);
checkConsistentMetadata(zzCurrent, serverList);
@@ -411,11 +409,11 @@ public void testRWRebalance() throws Exception {
Cluster currentCluster = ServerTestUtils.getLocalZonedCluster(4, 2, new int[] { 0, 0,
1, 1 }, new int[][] { { 0, 2, 4, 6 }, {}, { 1, 3, 5, 7 }, {} });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 3,
- Lists.newArrayList(2, 6));
+ 3,
+ Lists.newArrayList(2, 6));
finalCluster = UpdateClusterUtils.createUpdatedCluster(finalCluster,
- 1,
- Lists.newArrayList(3, 7));
+ 1,
+ Lists.newArrayList(3, 7));
// start all the servers
List<Integer> serverList = Arrays.asList(0, 1, 2, 3);
@@ -456,9 +454,11 @@ public void testRWRebalanceWithReplication(boolean serial) throws Exception {
{ 6 }, { 1, 3, 5 },
{ 7 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 3,
- Lists.newArrayList(2));
- finalCluster = UpdateClusterUtils.createUpdatedCluster(finalCluster, 1, Lists.newArrayList(3));
+ 3,
+ Lists.newArrayList(2));
+ finalCluster = UpdateClusterUtils.createUpdatedCluster(finalCluster,
+ 1,
+ Lists.newArrayList(3));
// start servers
List<Integer> serverList = Arrays.asList(0, 1, 2, 3);
@@ -517,11 +517,11 @@ public void testRebalanceCleanPrimarySecondary() throws Exception {
Cluster currentCluster = ServerTestUtils.getLocalZonedCluster(6, 2, new int[] { 0, 0,
0, 1, 1, 1 }, new int[][] { { 0 }, { 1, 6 }, { 2 }, { 3 }, { 4, 7 }, { 5 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 2,
- Lists.newArrayList(7));
+ 2,
+ Lists.newArrayList(7));
finalCluster = UpdateClusterUtils.createUpdatedCluster(finalCluster,
- 5,
- Lists.newArrayList(6));
+ 5,
+ Lists.newArrayList(6));
/**
* original server partition ownership
@@ -631,11 +631,11 @@ public void testProxyGetDuringRebalancing() throws Exception {
Cluster currentCluster = ServerTestUtils.getLocalZonedCluster(4, 2, new int[] { 0, 0,
1, 1 }, new int[][] { { 0, 2, 4 }, { 6 }, { 1, 3, 5 }, { 7 } });
Cluster tmpfinalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 3,
- Lists.newArrayList(2));
+ 3,
+ Lists.newArrayList(2));
final Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(tmpfinalCluster,
- 1,
- Lists.newArrayList(3));
+ 1,
+ Lists.newArrayList(3));
final List<Integer> serverList = Arrays.asList(0, 1, 2, 3);
Map<String, String> configProps = new HashMap<String, String>();
@@ -767,11 +767,11 @@ public void testProxyPutDuringRebalancing() throws Exception {
Cluster currentCluster = ServerTestUtils.getLocalZonedCluster(6, 2, new int[] { 0, 0,
0, 1, 1, 1 }, new int[][] { { 0 }, { 1, 6 }, { 2 }, { 3 }, { 4, 7 }, { 5 } });
Cluster finalCluster = UpdateClusterUtils.createUpdatedCluster(currentCluster,
- 2,
- Lists.newArrayList(7));
+ 2,
+ Lists.newArrayList(7));
finalCluster = UpdateClusterUtils.createUpdatedCluster(finalCluster,
- 5,
- Lists.newArrayList(6));
+ 5,
+ Lists.newArrayList(6));
/**
* Original partition map
View
21 test/unit/voldemort/client/rebalance/NonZonedRebalanceTest.java
@@ -16,12 +16,6 @@
package voldemort.client.rebalance;
-import java.util.Arrays;
-import java.util.Collection;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
/**
* Start VoldemortServer locally using ServerTestUtils and run rebalancing
@@ -29,23 +23,12 @@
*
*
*/
-@RunWith(Parameterized.class)
public class NonZonedRebalanceTest extends AbstractNonZonedRebalanceTest {
private final int NUM_KEYS = 20;
- public NonZonedRebalanceTest(boolean useNio) {
- super(useNio);
- }
-
- @Parameters
- public static Collection<Object[]> configs() {
- /*-
- return Arrays.asList(new Object[][] { { true, true }, { true, false }, { false, true },
- { false, false } });
- */
- return Arrays.asList(new Object[][] { { true }, { false } });
-
+ public NonZonedRebalanceTest() {
+ super();
}
@Override
View
20 test/unit/voldemort/client/rebalance/ZonedRebalanceTest.java
@@ -15,29 +15,13 @@
*/
package voldemort.client.rebalance;
-import java.util.Arrays;
-import java.util.Collection;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.junit.runners.Parameterized.Parameters;
-
-@RunWith(Parameterized.class)
public class ZonedRebalanceTest extends AbstractZonedRebalanceTest {
private final int NUM_KEYS = 100;
- public ZonedRebalanceTest(boolean useNio) {
- super(useNio);
- }
-
- @Parameters
- public static Collection<Object[]> configs() {
- /*-
- return Arrays.asList(new Object[][] { { true, true }, { true, false }, { false, true },
- { false, false } });
- */
- return Arrays.asList(new Object[][] { { true }, { false } });
+ public ZonedRebalanceTest() {
+ super();
}
@Override
Please sign in to comment.
Something went wrong with that request. Please try again.