Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler. - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.
Date
Msg-id CAH2L28u24A8mgZC=wvhai4fCfYgmsqoyYWm0vT9cQB3mipg4wQ@mail.gmail.com
Whole thread Raw
In response to Re: Prevent an error on attaching/creating a DSM/DSA from an interrupt handler.  (Daniel Gustafsson <daniel@yesql.se>)
List 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

pgsql-hackers by date:

Previous
From: Nikita Malakhov
Date:
Subject: Re: SQL/JSON json_table plan clause
Next
From: Sami Imseih
Date:
Subject: Re: n_ins_since_vacuum stats for aborted transactions