Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.
От | Rahila Syed |
---|---|
Тема | Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler. |
Дата | |
Msg-id | CAH2L28u24A8mgZC=wvhai4fCfYgmsqoyYWm0vT9cQB3mipg4wQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler. (Daniel Gustafsson <daniel@yesql.se>) |
Ответы |
Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.
|
Список | pgsql-hackers |
Hi Daniel,
Thank you for your review and code improvements.
Please find below some observations.
1. dsm_unpin_mapping(dsm_segment *seg)
+ if (CurrentResourceOwner && IsResourceOwnerReleasing(CurrentResourceOwner))
+ return;
Given that the function can return without setting resowner to a
CurrentResourceOwner which is not NULL, shall we change the function
signature to return true when "unpin" is successful and false when not?
This behavior existed earlier too, but adding the check has made it explicit.
Although this function is not currently in use, it would be beneficial to make
the API more verbose.
2. If value of IsResourceOwnerReleasing changes between dsm_create_descriptor
and attach_internal, the dsm segment and dsa area will end up with different resource owners.
Earlier the chances of CurrentResourceOwner changing between the two functions were zero.
May be something can be done to keep resowner assignments under both these functions
in sync.
Thank you,
Rahila Syed
Please find below some observations.
1. dsm_unpin_mapping(dsm_segment *seg)
+ if (CurrentResourceOwner && IsResourceOwnerReleasing(CurrentResourceOwner))
+ return;
Given that the function can return without setting resowner to a
CurrentResourceOwner which is not NULL, shall we change the function
signature to return true when "unpin" is successful and false when not?
This behavior existed earlier too, but adding the check has made it explicit.
Although this function is not currently in use, it would be beneficial to make
the API more verbose.
2. If value of IsResourceOwnerReleasing changes between dsm_create_descriptor
and attach_internal, the dsm segment and dsa area will end up with different resource owners.
Earlier the chances of CurrentResourceOwner changing between the two functions were zero.
May be something can be done to keep resowner assignments under both these functions
in sync.
Thank you,
Rahila Syed
В списке pgsql-hackers по дате отправления: