-
-
Notifications
You must be signed in to change notification settings - Fork 297
LWLocks for dynamic shared memory, with an ad-hoc implementation for parallel foreign scans #2141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Sorry for the delay. I didn't realize this was waiting for CI approval. Lets see what happens! |
|
Run "startup failure"? |
|
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
|
Fixed some cargo fmt issues, it still requires workflow approval to be run |
workingjubilee
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be rebased.
…parallel foreign scans
|
Test failure confirmed (this time for pg13, on previous run it failed with pg17 first). I'll investigate it further, thanks for your support |
|
On Windows, the "unwind" and "longjmp" mechanics are identical, which results in some irregularities. It may be best to account for this. |




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.