Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 20, 2022

Conversation

rjuju
Copy link
Contributor

@rjuju rjuju commented May 14, 2022

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.

rjuju added 3 commits May 14, 2022 14:54
Postgres hasn't called this function for more than a decade (even before
extensions were introduced), and version 15 officially removed it so let's get
rid of it too.
If for some reason the bgworker keeps crashing, this will limit the amount of
traces logged when restarting.
This is normally automatically done when a bgworker declares the
BGWORKER_BACKEND_DATABASE_CONNECTION flag, but our bgworker doesn't connect to
databases, even though it calls InitPostgres, which will still initialize a new
bacckend and thus participate to the ProcSignal infrastructure.

This wasn't a problem until recently, but now that DROP DATABASE relies on
PROCSIG_BARRIER to work on Windows (see commit
4eb2176318d0561846c1f9fb3c68bede799d640f) we need to respond to ProcSignal
notifications.
Copy link
Collaborator

@maksm90 maksm90 left a 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

Hook added upstream in 4f2400cb3f10aa79f99fba680c198237da28dd38.
@rjuju rjuju force-pushed the shmem_request_hook branch from 7c89eda to 5b50e78 Compare May 19, 2022 15:30
Copy link
Collaborator

@maksm90 maksm90 left a 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.

@shinderuk shinderuk merged commit af53205 into postgrespro:master May 20, 2022
@rjuju
Copy link
Contributor Author

rjuju commented May 20, 2022

Thanks!

Now that the pg15 beta has been released it also would be a good idea to tag a new release to help packagers.

@maksm90
Copy link
Collaborator

maksm90 commented May 20, 2022

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.

@rjuju
Copy link
Contributor Author

rjuju commented May 20, 2022

Ah, then yes I agree :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants