Re: [HACKERS] possible dsm bug in dsm_attach()

2015-04-02 Thread Robert Haas
On Wed, Mar 25, 2015 at 6:11 AM, Amit Kapila wrote: > I am facing an issue in case we need to create many segments for > large inheritance hierarchy. Attached patch fixes the problem for me. Sigh. You'd think I'd be able to write a 30-line patch without introducing not one but two stupid bugs.

Re: [HACKERS] possible dsm bug in dsm_attach()

2015-03-25 Thread Amit Kapila
On Tue, May 6, 2014 at 11:15 PM, Robert Haas wrote: > > On Tue, May 6, 2014 at 1:14 PM, Andres Freund wrote: > > On 2014-05-06 08:48:57 -0400, Robert Haas wrote: > >> On Tue, May 6, 2014 at 8:43 AM, Andres Freund wrote: > >> > The break because of refcnt == 1 doesn't generally seem to be a good

Re: [HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Robert Haas
On Tue, May 6, 2014 at 1:46 PM, Andres Freund wrote: >> > Fix attached. >> >> Committed, thanks. > > Heh. Not a fan of film references? :) I didn't quite put the pieces together there. I just thought the use of "you" was awkward. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Ent

Re: [HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Andres Freund
On 2014-05-06 13:45:13 -0400, Robert Haas wrote: > On Tue, May 6, 2014 at 1:14 PM, Andres Freund wrote: > > On 2014-05-06 08:48:57 -0400, Robert Haas wrote: > >> On Tue, May 6, 2014 at 8:43 AM, Andres Freund > >> wrote: > >> > The break because of refcnt == 1 doesn't generally seem to be a good

Re: [HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Robert Haas
On Tue, May 6, 2014 at 1:14 PM, Andres Freund wrote: > On 2014-05-06 08:48:57 -0400, Robert Haas wrote: >> On Tue, May 6, 2014 at 8:43 AM, Andres Freund wrote: >> > The break because of refcnt == 1 doesn't generally seem to be a good >> > idea. Why are we bailing if there's *any* segment that's i

Re: [HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Andres Freund
On 2014-05-06 08:48:57 -0400, Robert Haas wrote: > On Tue, May 6, 2014 at 8:43 AM, Andres Freund wrote: > > The break because of refcnt == 1 doesn't generally seem to be a good > > idea. Why are we bailing if there's *any* segment that's in the process > > of being removed? I think the check shoul

Re: [HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Robert Haas
On Tue, May 6, 2014 at 8:43 AM, Andres Freund wrote: > dsm_attach() does the following: > > nitems = dsm_control->nitems; > for (i = 0; i < nitems; ++i) > { > /* If the reference count is 0, the slot is actually unused. > */ > if (dsm_contro

[HACKERS] possible dsm bug in dsm_attach()

2014-05-06 Thread Andres Freund
Hi, dsm_attach() does the following: nitems = dsm_control->nitems; for (i = 0; i < nitems; ++i) { /* If the reference count is 0, the slot is actually unused. */ if (dsm_control->item[i].refcnt == 0) continue;