Skip to content

Commit

Permalink
Fix a bug with generate_search_blocks
Browse files Browse the repository at this point in the history
I think what's happening here is that generate_search_blocks
is doing the right thing, but only if the job never stops and restarts,
and only because the starting_from mutates the internal state
and that is remembered for the next check.

If the job restarts, it would lose that internal state and start over.

This also suggests that we should have a verification step
that asserts the search blocks aren't skipping anything,
perhaps that each block as a well-defined "successor" block
whose next starting value is +1 the last ending value,
or whose starting value is zero and the next level is +1 the last level.
  • Loading branch information
j2kun committed Feb 21, 2021
1 parent 1adf8e2 commit 5da4bbe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion riemann/generate_search_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_starting_index(
# last_index already has a divisor sum in the database. we need to go
# one step further, but the interface doesn't quite support it yet. So
# we generate one more block of size one.
return search_strategy.generate_search_blocks(
return search_strategy.starting_from(last_index).generate_search_blocks(
count=1, batch_size=1
)[0].ending_search_index

Expand Down

0 comments on commit 5da4bbe

Please sign in to comment.