Fix the allocator to use id ranges instead of limits
This commit is contained in:
parent
3c32c3319c
commit
aaf462682f
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Reference in a new issue