Permalink
Browse files

Fixes to rebalancing tests

-- Fix bdb misconfig to speed up ~10x
-- Disable the BlockingIO testing
  • Loading branch information...
1 parent e7022bc commit 93c9161b1c9da3924a1d37c846cc31ce455b22a2 @vinothchandar vinothchandar committed Oct 8, 2013
@@ -70,7 +70,7 @@
private List<String> activeHostNames = new ArrayList<String>();
public Ec2RebalanceTest() {
- super(true);
+ super();
}
@BeforeClass
@@ -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);
@@ -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
@@ -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
@@ -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>();
@@ -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(),
Oops, something went wrong.

0 comments on commit 93c9161

Please sign in to comment.