LWLocks for dynamic shared memory, with an ad-hoc implementation for parallel foreign scans#2141
Open
fkomauli wants to merge 1 commit intopgcentralfoundation:developfrom
Open
LWLocks for dynamic shared memory, with an ad-hoc implementation for parallel foreign scans#2141fkomauli wants to merge 1 commit intopgcentralfoundation:developfrom
fkomauli wants to merge 1 commit intopgcentralfoundation:developfrom
Conversation
Contributor
|
Sorry for the delay. I didn't realize this was waiting for CI approval. Lets see what happens! |
Author
|
Run "startup failure"? |
Contributor
|
You might need to push something to this PR in order to get the tests to run. Something didn't work like it's supposed to. |
15ae6cd to
eac70c9
Compare
Author
|
Fixed some cargo fmt issues, it still requires workflow approval to be run |
Author
workingjubilee
requested changes
Oct 30, 2025
Member
workingjubilee
left a comment
There was a problem hiding this comment.
This should be rebased.
Author
|
Test failure confirmed (this time for pg13, on previous run it failed with pg17 first). I'll investigate it further, thanks for your support |
Member
|
On Windows, the "unwind" and "longjmp" mechanics are identical, which results in some irregularities. It may be best to account for this. |
…parallel foreign scans
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.




The primary goal of this PR is to implement a mechanism for locking dynamic shared memory (DSM) provided to worker processes during a parallel foreign scan.
The proposed solution is based on three layers:
PgSharedMemoryInitializationtrait and thepg_shmem_init!macro;pgrx_*_foreign_scan).Tests
This PR implements the same test coverage of PgLwLock for the new lock mechanisms. I didn't find a clean way to test BgWorkers and shared memory using the introduced lock types. Instead, I provided an example implementation in
pgrx-examples/parallel_scan_lwlockthat allows executing parallel scans, whose workers access a shared resource (a naive counter) as the source of tuples for foreign tables.If you have any suggestion, I'll proceed to integrate the test suite.