Unify parallel worker handling for index builds and instrumentation#77
Open
lfittl wants to merge 4 commits into
Open
Unify parallel worker handling for index builds and instrumentation#77lfittl wants to merge 4 commits into
lfittl wants to merge 4 commits into
Conversation
This simplifies the DSM allocations a bit since we don't need to separately allocate WAL and buffer usage, and allows the easier future addition of a third stack-based struct being discussed. In passing, adjust InstrAccumParallelQuery to handle multiple workers: All callers currently have a loop to call the accumulation for each worker and a local loop variable defined. To slightly simplify the callers, move the loop into the InstrAccumParallelQuery function and add a new "nworkers" argument to it. Author: Lukas Fittl <lukas@fittl.com> Reviewed-by: Discussion:
Similar to query text, introduce helpers to estimate the shared memory required for instrumentation, and for allocating and storing it in shared memory. Author: Lukas Fittl <lukas@fittl.com> Reviewed-by: Discussion:
Multiple callers (parallel index builds, parallel vacuum, parallel query) all had the same implementation for passing query text to the parallel workers. To reduce duplicated code, introduce new helper functions to: (1) estimate the needed shared memory space for the query text, (2) store the query text in shared memory, and (3) restore the query text in the worker. Author: Lukas Fittl <lukas@fittl.com> Reviewed-by: Discussion:
The three in-tree index AMs that currently support parallel index builds (nbtree, gin and brin) each share very similar code for initializing parallel workers, allocating shared memory and communicating between the leader and the workers. To reduce duplication, introduce shared helpers for parallel index builds, unifiying the existing code. This also fixes an oversight in parallel GIN index builds that forgot to pass the queryid to the parallel workers, like other AMs do. Author: Lukas Fittl <lukas@fittl.com> Reviewed-by: Discussion:
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.