-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: calculate decode priority correctly (#2841)
When decoding we have to "wait until more than X rows are ready" There was an issue with how we handled empty lists. For example, if the list offsets are: ``` # List sizes = [10, 20, 30, 0, 40] 0 10 30 60 60 100 ``` The question is what do we do when we need to wait until more than 3 rows are ready. 3 rows means we have 60 items. The old logic looked for the next offset greater than 60 (i.e. 100) and waited until we had 100 items. This mirrors some logic we do on the reverse side when we calculate how many rows are available based on how many items we have. However, that is wrong. If we have 60 items we actually have 4 rows available and so we have more than 3 rows available. The logic is much simpler. Just wait until we have at least `offsets[desired_rows + 1]` items. If that value is equal to `offsets[desired_rows]` it doesn't matter, we don't need to do any special logic. If we wait for too many rows it can lead to deadlock in certain situations.
- Loading branch information
1 parent
6016917
commit c8fe1dd
Showing
4 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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