-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
44901: colexec: add "recursive" merging to external sort r=yuzefovich a=yuzefovich **colexec: add "recursive" merging to external sort** Previously, external sorter was merging all partitions at once (i.e. there was a single merger). This is problematic because each partition uses some amount of RAM for its buffer, we want to make sure that all partitions together do not exceed the memory limit. Now this is addressed by splitting previous "merging" stage into three: 1. new "repeated merging" stage is now responsible for merging all current partitions and spilling new partitions to disk until only one is left. This might be performed while we're still consuming the input. 2. new "final merging" stage that sets up an emitter that can merge all the remaining partitions. This occurs only when the input has been fully consumed and we can merge all the partitions at once, without having to spill to disk. 3. new " emitting" stage that simply emits the output. Addresses: #44727. Release note: None **colexec: fix external sorter memory accounting** Previously, there was a problem with inputPartitioningOperator (which divides up the input into "partitions" once the partition exceeds the provided memory limit) because usage of Allocator.Clear is not compatible with Allocator.PerformOperation. Now this problem is fixed by explicitly tracking the memory used by the input batches with RetainBatch against a "standalone" allocator. We're using standalone budget for that to avoid double counting for the memory of the batch (they are accounted already with unlimitedAllocator of the sorter). Fixes: #45043. Release note: None 45184: jobs: trigger job adoption on registry Run() r=pbardea a=pbardea To quickly trigger the adoption of a job, make the job registry listen to a channel which will be triggered when a job is run. Release note: None 45244: colexec: miscellaneous HashRouter fixes r=yuzefovich a=asubiotto This commit fixes several bugs and discomforts related to the HashRouter observed when running tpch queries. 1) RetainBatch and ReleaseBatch weren't accounting for the selection vector, resulting in a slight memory leak. 2) HashRouter disk spilling infrastructure was not being cleaned up on successful termination. 3) HashRouter memory monitor names were not unique, they now contain the output StreamIDs. Example: hash-router-[1,2,3]-unlimited. 4) A big memory accounting leak was happening when returning an in-memory pending batch. This batch is a staging area that is flushed to disk when full, but returned if a read occurs before that. The batch was being returned without changing the memory account. Since batches are unsafe for reuse, the HashRouter should call ReleaseBatch in this case. 5) Tests would ignore if Run returned an error, resulting in hard-to-decipher failures where no output was returned. Run is now checked for errors before verifying the output. Release note: None (bug fixes related to vectorize=experimental_on) Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Paul Bardea <[email protected]> Co-authored-by: Alfonso Subiotto Marques <[email protected]>
- Loading branch information
Showing
12 changed files
with
361 additions
and
114 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
Oops, something went wrong.