This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Repository navigation
Ensure portdb selects _all_ rows with negative rowids - #13226
Merged
Merged
Conversation
added 2 commits
July 8, 2022 14:52
The `backward_select` query uses the `backward_chunk` variable as an inclusive upper bound on the rowids it selects. It is initially 0 (see `setup_table`). It is then set to ``` backward_chunk = min(row[0] for row in brows) - 1 ``` where `brows` is the result of running the `backwards_select` query. For this to make sense, we need to ensure that `backwards_select` picks rows 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.
erikjohnston
approved these changes
Jul 11, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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_selectquery uses thebackward_chunkvariable as aninclusive upper bound on the rowids it selects. It is initially 0 (see
setup_table). It is then set towhere
browsis the result of running thebackwards_selectquery.For this to make sense, we need to ensure that
backwards_selectpicksrows 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.