Re: Retain dynamic shared memory segments for postmaster lifetime

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Retain dynamic shared memory segments for postmaster lifetime
Date: 2014-02-08 07:31:32
Message-ID: CAA4eK1JWNOp5hTUvRDW4505LGrrFLCE--FAMeAoHA9ANiWVc7A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Thu, Feb 6, 2014 at 3:42 PM, Kyotaro HORIGUCHI
> <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp> wrote:
>> Hello, I've understood how this works and seems working as
>> expected.
>>
>>
>> The orphan section handles on postmaster have become a matter of
>> documentation.

I had explained this in function header of dsm_keep_segment().

>> Besides all above, I'd like to see a comment for the win32 code
>> about the 'DuplicateHandle hack', specifically, description that
>> the DuplicateHandle pushes the copy of the section handle to the
>> postmaster so the section can retain for the postmaster lifetime.

I had added a new function in dsm_impl.c for platform specific
handling and explained about new behaviour in function header.

> - "Global/PostgreSQL.%u" is the same literal constant with that
> occurred in dsm_impl_windows. It should be defined as a
> constant (or a macro).

Changed to hash define.

> - dms_impl_windows uses errcode_for_dynamic_shared_memory() for
> ereport and it finally falls down to
> errcode_for_file_access(). I think it is preferable, maybe

Changed as per suggestion.

Please find new version of patch attached with this mail containing
above changes.

Thanks for review.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
dsm_keep_segment_v3.patch application/octet-stream 4.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-02-08 16:40:23 Postgres back-branch minor updates coming soon
Previous Message Tom Lane 2014-02-08 06:51:02 Re: [HACKERS] Viability of text HISTORY/INSTALL/regression README files (was Re: [COMMITTERS] pgsql: Document a few more regression test hazards.)