[join-] load all sheets before joins #2351
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.
When joins are done on sheets that are loading, rows can be lost in the new sheet.
repro:
seq 10000000 > 10m.tsv; vd 10m.tsv sample_data/test.fixed
While the larger sheet is loading, go to the Sheets sheet with
S
, quickly select both sheets,&
to join, thenappend
. The final sheet should have 10,000,002 rows, but if the join is started quickly enough, it won't.The requirements for rows to be lost here are:
The problem is how we use
BaseSheet.ensureLoaded()
. We currently use its return value to decide whether a sheet has finished loading. But we can only do that if it hasn't been called for that sheet before. If it has been called before, it will returnNone
even when the sheet is still loading.For the sheet on screen,
ensureLoaded()
is called before, bydrawSheet()
inmainloop.py
. So we cannot use its return value injoin.py
to guide the decision to callsync()
.This PR changes the
sync()
to be done unconditionally.It also fixes errors calculating progress while the number of final rows is not yet known (dd1e3fe).
And adds a loading Progress indicator during all the syncs.