Skip to content
Browse files

make sure we don't allocate new shards at the same time

  • Loading branch information...
1 parent 3b47b16 commit 4a397d8de4a7a3c34ec6efaa1cb5d98c8f696fab @tjake committed Jul 5, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/lucandra/cluster/CassandraIndexManager.java
View
5 src/lucandra/cluster/CassandraIndexManager.java
@@ -902,8 +902,9 @@ private int getRandomSequenceOffset(int offset)
// initialize shards we didn't know about
if (offset == null)
{
- updateNodeOffset(shards.indexName, myToken, shard.getKey(), -1);
+ RowMutation rm = updateNodeOffset(shards.indexName, myToken, shard.getKey(), -1);
offset = nodes.nodes.get(myToken);
+ CassandraUtils.robustInsert(ConsistencyLevel.QUORUM, rm);
}
int randomSeqOffset = getRandomSequenceOffset(offset.get());
@@ -935,7 +936,7 @@ private int getRandomSequenceOffset(int offset)
private NodeInfo addNewShard(String indexName) throws IOException
{
- ShardInfo shards = getShardInfo(indexName, false);
+ ShardInfo shards = getShardInfo(indexName, true);
// get max shard
Integer maxShard = -1;

0 comments on commit 4a397d8

Please sign in to comment.
Something went wrong with that request. Please try again.