Fix the allocator to use id ranges instead of limits

This commit is contained in:
Jake Moshenko 2016-01-12 15:21:13 -05:00
parent 3c32c3319c
commit aaf462682f

View file

@ -133,8 +133,8 @@ def yield_random_entries(batch_query, primary_key_field, batch_size, max_id):
while True:
start_index = allocator.get_block_start_index(batch_size)
all_candidates = list(batch_query()
.limit(batch_size)
.where(primary_key_field >= start_index))
.where(primary_key_field >= start_index,
primary_key_field <= start_index + batch_size))
if len(all_candidates) == 0:
logger.info('No candidates, new highest id: %s', start_index)