Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't exceed the shard size when refreshing reserves

  • Loading branch information...
commit 35b972eea0177dbc3974c0133ab28513ffd961d0 1 parent a10ea40
@tjake authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/lucandra/cluster/CassandraIndexManager.java
View
6 src/lucandra/cluster/CassandraIndexManager.java
@@ -374,8 +374,8 @@ private synchronized ShardInfo getShardInfo(String indexName, boolean force) thr
nodes.nodes.put(token, offset);
shards.shards.put(shardNum, nodes);
- // Load this reserve if there is more to go.
- if (offset.get() < (maxDocsPerShard - 1))
+ // Load this reserve if there is at least 100 more to go.
+ if ((offset.get()+100) < (maxDocsPerShard - 1))
{
int seqOffset = getRandomSequenceOffset(offset.get() + 100);
int prevSeqOffset = getRandomSequenceOffset(offset.get() - 1);
@@ -388,7 +388,7 @@ private synchronized ShardInfo getShardInfo(String indexName, boolean force) thr
logger.info("Found reserved shard" + shardStr + "(" + token + "):"
+ (offset.get() + 100) + " TO "
+ (randomSeq[seqOffset] + reserveSlabSize));
- allNodeRsvps.rsvpList.add(new RsvpInfo(offset.get() + 100, (randomSeq[seqOffset]
+ allNodeRsvps.rsvpList.add(new RsvpInfo(offset.get() + 100 , (randomSeq[seqOffset]
+ reserveSlabSize - 1), nodes.shard, token, nextTTL));
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.