aio: worker: Free SMGR objects when idle - #428
Open
pg-hub-mirror[bot] wants to merge 1 commit into
Open
pg-hub-mirror[bot] wants to merge 1 commit into
pg-hub-mirror[bot] wants to merge 1 commit into
Conversation
IO workers create SMGR objects when reopening relations, but don't have a transaction-end cleanup to destroy them. Long-lived workers can therefore retain entries for an increasing number of relations, including dropped ones. Destroy these objects when when a completed checkpoint is observed and when the worker is idle. At this point no borrowed descriptors or SMGR references remain in use.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
pgsql-hackersCAN55FZ2BesKUnajdgpw1fPSe3S6_CHOugryaUEtD7vdP=dRKEQ@mail.gmail.comPatch files:
Hi,
IO worker processes call smgropen with smgr_aio_reopen() -> smgropen()
path. smgropen() has a comment mentioning:
/*
/*
Since, IO workers call this function outside of a transaction,
smgrdestroy() needs to be called. Attached patch calls smgrdestroy()
when the IO worker is idle. There is a chance that IO workers won't be
idle forever, so we might want to trigger this after #n number of IOs
too but I didn't implement like that for the sake of simplicity.
--
Regards,
Nazir Bilal Yavuz
Microsoft