-
-
Notifications
You must be signed in to change notification settings - Fork 22
fix: incorrect shared memory setup #222
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
Conversation
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.
Before the shared memory wasn't guarded with lwlocks plus there was no call to RequestAddinShmemSpace to estimate used memory (the latter only available on pg >= 15).
Thank you for the PR! I think RequestAddinShmemSpace()
itself is available before Postgres 15, but indeed shmem_request_hook
hook was added on Postgres 15 only. Before 15 extensions were requesting memory within _PG_init()
typically. See:
https://github.com/postgres/postgres/blob/REL_14_18/contrib/pg_prewarm/autoprewarm.c#L141
And here is the commit which changed it:
I added this suggestion below.
Before the shared memory wasn't guarded with lwlocks plus there was no call to RequestAddinShmemSpace to estimate used memory. Closes supabase#220
@za-arthur Many thanks for the review 💚. Already made the changes. |
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.
Thanks. LGTM.
Before the shared memory wasn't guarded with lwlocks plus there was no call to RequestAddinShmemSpace to estimate used memory (the latter only available on pg >= 15).
Closes #220