- Notifications
You must be signed in to change notification settings - Fork38
Various fixes for compatibility with pg 15#49
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Postgres hasn't called this function for more than a decade (even beforeextensions were introduced), and version 15 officially removed it so let's getrid of it too.
If for some reason the bgworker keeps crashing, this will limit the amount oftraces logged when restarting.
This is normally automatically done when a bgworker declares theBGWORKER_BACKEND_DATABASE_CONNECTION flag, but our bgworker doesn't connect todatabases, even though it calls InitPostgres, which will still initialize a newbacckend and thus participate to the ProcSignal infrastructure.This wasn't a problem until recently, but now that DROP DATABASE relies onPROCSIG_BARRIER to work on Windows (see commit4eb2176318d0561846c1f9fb3c68bede799d640f) we need to respond to ProcSignalnotifications.
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 a lot for this PR. Approve with some little requirement of cosmetic change
Uh oh!
There was an error while loading.Please reload this page.
Hook added upstream in 4f2400cb3f10aa79f99fba680c198237da28dd38.
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.
@shinderuk I think this PR might be merged.
Uh oh!
There was an error while loading.Please reload this page.
Thanks! Now that the pg15 beta has been released it also would be a good idea to tag a new release to help packagers. |
I think it makes sense to do this after some planning refactoring changes. The time up to PG15 release is much enough and I expect to complete refactoring before this event. |
Ah, then yes I agree :) |
I entirely removed the _PG_fini() function, which was removed upstream in ab02d702ef08343fba30d90fdf7df5950063e8c9.
I handled the new shmem_request_hook to reqest additional resources, and while testing it I realized that a recent commit to fix DROP DATABASE on windows revealed that the bgworker entirely ignored the ProcSignal notifications. This wasn't really a problem, but now that DROP DATABASE actively wait for all backends to respond to the PROCSIG_BARRIER message it is a problem.
While doing that test I also realized that the bgworker is restarted immediately in case of unexpected shutdown, which can massively spam the logs. I added a 1s timeout before restarting to help with that.