This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Ensure portdb selects _all_ rows with negative rowids #13226
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#982 tried to fix this problem (missing rows with negative row ids), but unfortunately it only selected at most one batch_size's worth of such rows (default: 1000).
The
backward_select
query uses thebackward_chunk
variable as aninclusive upper bound on the rowids it selects. It is initially 0 (see
setup_table
). It is then set towhere
brows
is the result of running thebackwards_select
query.For this to make sense, we need to ensure that
backwards_select
picksrows in descending order. Otherwise we'll jump right to the bottom of
the rowids, pick out the lowest batch only and discard everything we
skipped over. This is a Bad Thing.
I've tested this locally with the reproduction case reported in #13191.
Without the patch, I could reproduce the reported failure; with the
patch, the portdb script completes successfully. I sanity checked that
the postgres table had the right number of rows in events and
events_edges too.