Lists: | pgsql-hackers |
---|
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | [Patch] remove duplicated smgrclose |
Date: | 2024-07-31 03:15:47 |
Message-ID: | CABBtG=cDTCBDCBK7McSy6bJR3s5xUTOg0vSFfuW8oLdUYyCscA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hello, hackers,
I think there may be some duplicated codes.
Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
smgrclose().
But both functions would close SMgrRelation object, it's dupliacted
behavior?
So I make this patch. Could someone take a look at it?
Thanks for your help,
Steven
From Highgo.com
Attachment | Content-Type | Size |
---|---|---|
0001-remove-duplicated-smgrclose.patch | application/octet-stream | 2.1 KB |
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-01 12:32:11 |
Message-ID: | CAEG8a3L9qHCw3nWT1iwuHdHMcghqLWxDyu+F0ioDZrZJ1d8Ffw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi Steven,
On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
> Hello, hackers,
>
> I think there may be some duplicated codes.
> Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
> But both functions would close SMgrRelation object, it's dupliacted behavior?
>
> So I make this patch. Could someone take a look at it?
>
> Thanks for your help,
> Steven
>
> From Highgo.com
>
>
You change LGTM, but the patch seems not to be applied to HEAD,
I generate the attached v2 using `git format` with some commit message.
--
Regards
Junwang Zhao
Attachment | Content-Type | Size |
---|---|---|
v2-0001-remove-duplicated-smgrclose.patch | application/octet-stream | 2.4 KB |
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-02 04:12:39 |
Message-ID: | CABBtG=funw1K7s5AJ4SQrWCZ9kGqYLoKh2gAZq94rAUizS4HQA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi, Junwang,
Thank you for the review and excellent summary in commit message!
This is my first contribution to community, and not so familiar with the
overall process.
After reading the process again, it looks like that I'm not qualified to
submit the patch to commitfest as I never had reviewed others' work. :(
If so, could you please help to submit it to commitfest?
Best Regards,
Steven
Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月1日周四 20:32写道:
> Hi Steven,
>
> On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >
> > Hello, hackers,
> >
> > I think there may be some duplicated codes.
> > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
> smgrclose().
> > But both functions would close SMgrRelation object, it's dupliacted
> behavior?
> >
> > So I make this patch. Could someone take a look at it?
> >
> > Thanks for your help,
> > Steven
> >
> > From Highgo.com
> >
> >
> You change LGTM, but the patch seems not to be applied to HEAD,
> I generate the attached v2 using `git format` with some commit message.
>
> --
> Regards
> Junwang Zhao
>
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-02 05:22:38 |
Message-ID: | CAEG8a3+RLA5tkSAqHeXfhtxoF4vbJMwBBOuVZur_rOWo9QGquA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi Steven,
On Fri, Aug 2, 2024 at 12:12 PM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
> Hi, Junwang,
>
> Thank you for the review and excellent summary in commit message!
>
> This is my first contribution to community, and not so familiar with the overall process.
> After reading the process again, it looks like that I'm not qualified to submit the patch to commitfest as I never had reviewed others' work. :(
> If so, could you please help to submit it to commitfest?
>
https://commitfest.postgresql.org/49/5149/
I can not find your profile on commitfest so I left the author as empty,
have you ever registered? If you have a account, you can put your
name in the Authors list.
> Best Regards,
> Steven
>
> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月1日周四 20:32写道:
>>
>> Hi Steven,
>>
>> On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>> >
>> > Hello, hackers,
>> >
>> > I think there may be some duplicated codes.
>> > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
>> > But both functions would close SMgrRelation object, it's dupliacted behavior?
>> >
>> > So I make this patch. Could someone take a look at it?
>> >
>> > Thanks for your help,
>> > Steven
>> >
>> > From Highgo.com
>> >
>> >
>> You change LGTM, but the patch seems not to be applied to HEAD,
>> I generate the attached v2 using `git format` with some commit message.
>>
>> --
>> Regards
>> Junwang Zhao
--
Regards
Junwang Zhao
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-02 07:36:33 |
Message-ID: | CABBtG=decxEmHbtAD4TaW8apGcGUu36ZLh-DM5ZALUq1DP0Usg@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Thanks, I have set my name in the Authors column of CF.
Steven
Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月2日周五 13:22写道:
> Hi Steven,
>
> On Fri, Aug 2, 2024 at 12:12 PM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >
> > Hi, Junwang,
> >
> > Thank you for the review and excellent summary in commit message!
> >
> > This is my first contribution to community, and not so familiar with the
> overall process.
> > After reading the process again, it looks like that I'm not qualified to
> submit the patch to commitfest as I never had reviewed others' work. :(
> > If so, could you please help to submit it to commitfest?
> >
>
> https://commitfest.postgresql.org/49/5149/
>
> I can not find your profile on commitfest so I left the author as empty,
> have you ever registered? If you have a account, you can put your
> name in the Authors list.
>
> > Best Regards,
> > Steven
> >
> > Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月1日周四 20:32写道:
> >>
> >> Hi Steven,
> >>
> >> On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >> >
> >> > Hello, hackers,
> >> >
> >> > I think there may be some duplicated codes.
> >> > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
> smgrclose().
> >> > But both functions would close SMgrRelation object, it's dupliacted
> behavior?
> >> >
> >> > So I make this patch. Could someone take a look at it?
> >> >
> >> > Thanks for your help,
> >> > Steven
> >> >
> >> > From Highgo.com
> >> >
> >> >
> >> You change LGTM, but the patch seems not to be applied to HEAD,
> >> I generate the attached v2 using `git format` with some commit message.
> >>
> >> --
> >> Regards
> >> Junwang Zhao
>
>
>
> --
> Regards
> Junwang Zhao
>
From: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-09 09:20:15 |
Message-ID: | CALdSSPhdZfUa5YXaVta=RzPtjnmP-nF_hajFCATjXJ=Enynb6w@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>
> Hi Steven,
>
> On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >
> > Hello, hackers,
> >
> > I think there may be some duplicated codes.
> > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
> > But both functions would close SMgrRelation object, it's dupliacted behavior?
> >
> > So I make this patch. Could someone take a look at it?
> >
> > Thanks for your help,
> > Steven
> >
> > From Highgo.com
> >
> >
> You change LGTM, but the patch seems not to be applied to HEAD,
> I generate the attached v2 using `git format` with some commit message.
>
> --
> Regards
> Junwang Zhao
Hi all!
This change looks good to me. However, i have an objection to these
lines from v2:
> /* Close the forks at smgr level */
> - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> - smgrsw[which].smgr_close(rels[i], forknum);
> + smgrclose(rels[i]);
Why do we do this? This seems to be an unrelated change given thread
$subj. This is just a pure refactoring job, which deserves a separate
patch. There is similar coding in
smgrdestroy function:
```
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
smgrsw[reln->smgr_which].smgr_close(reln, forknum);
```
So, I feel like these two places should be either changed together or
not be altered at all. And is it definitely a separate change.
--
Best regards,
Kirill Reshke
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
Cc: | Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-09 10:19:11 |
Message-ID: | CAEG8a3Kk+BLq52ijQMg6+793RRC61tghobRw3pJOJ1RY2VoTQg@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> >
> > Hi Steven,
> >
> > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> > >
> > > Hello, hackers,
> > >
> > > I think there may be some duplicated codes.
> > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
> > > But both functions would close SMgrRelation object, it's dupliacted behavior?
> > >
> > > So I make this patch. Could someone take a look at it?
> > >
> > > Thanks for your help,
> > > Steven
> > >
> > > From Highgo.com
> > >
> > >
> > You change LGTM, but the patch seems not to be applied to HEAD,
> > I generate the attached v2 using `git format` with some commit message.
> >
> > --
> > Regards
> > Junwang Zhao
>
> Hi all!
> This change looks good to me. However, i have an objection to these
> lines from v2:
>
> > /* Close the forks at smgr level */
> > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > - smgrsw[which].smgr_close(rels[i], forknum);
> > + smgrclose(rels[i]);
>
> Why do we do this? This seems to be an unrelated change given thread
> $subj. This is just a pure refactoring job, which deserves a separate
> patch. There is similar coding in
> smgrdestroy function:
>
> ```
> for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> ```
>
> So, I feel like these two places should be either changed together or
> not be altered at all. And is it definitely a separate change.
Yeah, I tend to agree with you, maybe we should split the patch
into two.
Steven, could you do this?
>
> --
> Best regards,
> Kirill Reshke
--
Regards
Junwang Zhao
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-12 10:11:42 |
Message-ID: | CABBtG=fB_cLmiAB9Xmd9qCcmcEH5D5107emRmdUsJcRMxYj+Nw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Kirill,
Good catch!
I will split the patch into two to cover both cases.
Thanks,
Steven
Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com>
> wrote:
> >
> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> > >
> > > Hi Steven,
> > >
> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com>
> wrote:
> > > >
> > > > Hello, hackers,
> > > >
> > > > I think there may be some duplicated codes.
> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
> smgrclose().
> > > > But both functions would close SMgrRelation object, it's dupliacted
> behavior?
> > > >
> > > > So I make this patch. Could someone take a look at it?
> > > >
> > > > Thanks for your help,
> > > > Steven
> > > >
> > > > From Highgo.com
> > > >
> > > >
> > > You change LGTM, but the patch seems not to be applied to HEAD,
> > > I generate the attached v2 using `git format` with some commit message.
> > >
> > > --
> > > Regards
> > > Junwang Zhao
> >
> > Hi all!
> > This change looks good to me. However, i have an objection to these
> > lines from v2:
> >
> > > /* Close the forks at smgr level */
> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > > - smgrsw[which].smgr_close(rels[i], forknum);
> > > + smgrclose(rels[i]);
> >
> > Why do we do this? This seems to be an unrelated change given thread
> > $subj. This is just a pure refactoring job, which deserves a separate
> > patch. There is similar coding in
> > smgrdestroy function:
> >
> > ```
> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> > ```
> >
> > So, I feel like these two places should be either changed together or
> > not be altered at all. And is it definitely a separate change.
>
> Yeah, I tend to agree with you, maybe we should split the patch
> into two.
>
> Steven, could you do this?
>
> >
> > --
> > Best regards,
> > Kirill Reshke
>
>
>
> --
> Regards
> Junwang Zhao
>
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-14 06:35:39 |
Message-ID: | CABBtG=f3e+jGFZsTJuMUW=Bvt0ToJQ-4tfYU9sASmJ-7V6Bc-w@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Junwang, Kirill,
The split work has been done. I created a new patch for removing
redundant smgrclose() function as attached.
Please help review it.
Thanks,
Steven
Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
> Kirill,
>
> Good catch!
> I will split the patch into two to cover both cases.
>
> Thanks,
> Steven
>
>
> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
>
>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com>
>> wrote:
>> >
>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>> > >
>> > > Hi Steven,
>> > >
>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com>
>> wrote:
>> > > >
>> > > > Hello, hackers,
>> > > >
>> > > > I think there may be some duplicated codes.
>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
>> smgrclose().
>> > > > But both functions would close SMgrRelation object, it's dupliacted
>> behavior?
>> > > >
>> > > > So I make this patch. Could someone take a look at it?
>> > > >
>> > > > Thanks for your help,
>> > > > Steven
>> > > >
>> > > > From Highgo.com
>> > > >
>> > > >
>> > > You change LGTM, but the patch seems not to be applied to HEAD,
>> > > I generate the attached v2 using `git format` with some commit
>> message.
>> > >
>> > > --
>> > > Regards
>> > > Junwang Zhao
>> >
>> > Hi all!
>> > This change looks good to me. However, i have an objection to these
>> > lines from v2:
>> >
>> > > /* Close the forks at smgr level */
>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>> > > - smgrsw[which].smgr_close(rels[i], forknum);
>> > > + smgrclose(rels[i]);
>> >
>> > Why do we do this? This seems to be an unrelated change given thread
>> > $subj. This is just a pure refactoring job, which deserves a separate
>> > patch. There is similar coding in
>> > smgrdestroy function:
>> >
>> > ```
>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
>> > ```
>> >
>> > So, I feel like these two places should be either changed together or
>> > not be altered at all. And is it definitely a separate change.
>>
>> Yeah, I tend to agree with you, maybe we should split the patch
>> into two.
>>
>> Steven, could you do this?
>>
>> >
>> > --
>> > Best regards,
>> > Kirill Reshke
>>
>>
>>
>> --
>> Regards
>> Junwang Zhao
>>
>
Attachment | Content-Type | Size |
---|---|---|
v3-0001-remove-duplicated-smgrclose.patch | application/octet-stream | 1.9 KB |
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-15 10:03:45 |
Message-ID: | CAEG8a3JnsZ_FawLcGKsChKxQNQMNvx5mz-YUK-noXGZZLZ4YKg@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, Aug 14, 2024 at 2:35 PM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
> Junwang, Kirill,
>
> The split work has been done. I created a new patch for removing redundant smgrclose() function as attached.
> Please help review it.
Patch looks good, actually you can make the refactoring code as v3-0002-xxx
by using:
git format-patch -2 -v 3
Another kind reminder: Do not top-post when you reply ;)
>
> Thanks,
> Steven
>
> Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
>>
>> Kirill,
>>
>> Good catch!
>> I will split the patch into two to cover both cases.
>>
>> Thanks,
>> Steven
>>
>>
>> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
>>>
>>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>>> >
>>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>>> > >
>>> > > Hi Steven,
>>> > >
>>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>>> > > >
>>> > > > Hello, hackers,
>>> > > >
>>> > > > I think there may be some duplicated codes.
>>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
>>> > > > But both functions would close SMgrRelation object, it's dupliacted behavior?
>>> > > >
>>> > > > So I make this patch. Could someone take a look at it?
>>> > > >
>>> > > > Thanks for your help,
>>> > > > Steven
>>> > > >
>>> > > > From Highgo.com
>>> > > >
>>> > > >
>>> > > You change LGTM, but the patch seems not to be applied to HEAD,
>>> > > I generate the attached v2 using `git format` with some commit message.
>>> > >
>>> > > --
>>> > > Regards
>>> > > Junwang Zhao
>>> >
>>> > Hi all!
>>> > This change looks good to me. However, i have an objection to these
>>> > lines from v2:
>>> >
>>> > > /* Close the forks at smgr level */
>>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>>> > > - smgrsw[which].smgr_close(rels[i], forknum);
>>> > > + smgrclose(rels[i]);
>>> >
>>> > Why do we do this? This seems to be an unrelated change given thread
>>> > $subj. This is just a pure refactoring job, which deserves a separate
>>> > patch. There is similar coding in
>>> > smgrdestroy function:
>>> >
>>> > ```
>>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
>>> > ```
>>> >
>>> > So, I feel like these two places should be either changed together or
>>> > not be altered at all. And is it definitely a separate change.
>>>
>>> Yeah, I tend to agree with you, maybe we should split the patch
>>> into two.
>>>
>>> Steven, could you do this?
>>>
>>> >
>>> > --
>>> > Best regards,
>>> > Kirill Reshke
>>>
>>>
>>>
>>> --
>>> Regards
>>> Junwang Zhao
--
Regards
Junwang Zhao
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-16 05:16:33 |
Message-ID: | CABBtG=ebeSKSpYJhDon2U0MsjvVW6nOrTm9ACDj40rqxD6jV2g@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月15日周四 18:03写道:
> On Wed, Aug 14, 2024 at 2:35 PM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >
> > Junwang, Kirill,
> >
> > The split work has been done. I created a new patch for removing
> redundant smgrclose() function as attached.
> > Please help review it.
>
> Patch looks good, actually you can make the refactoring code as v3-0002-xxx
> by using:
>
> git format-patch -2 -v 3
>
> Another kind reminder: Do not top-post when you reply ;)
>
> >
> > Thanks,
> > Steven
> >
> > Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
> >>
> >> Kirill,
> >>
> >> Good catch!
> >> I will split the patch into two to cover both cases.
> >>
> >> Thanks,
> >> Steven
> >>
> >>
> >> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
> >>>
> >>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com>
> wrote:
> >>> >
> >>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> >>> > >
> >>> > > Hi Steven,
> >>> > >
> >>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com>
> wrote:
> >>> > > >
> >>> > > > Hello, hackers,
> >>> > > >
> >>> > > > I think there may be some duplicated codes.
> >>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and
> smgrclose().
> >>> > > > But both functions would close SMgrRelation object, it's
> dupliacted behavior?
> >>> > > >
> >>> > > > So I make this patch. Could someone take a look at it?
> >>> > > >
> >>> > > > Thanks for your help,
> >>> > > > Steven
> >>> > > >
> >>> > > > From Highgo.com
> >>> > > >
> >>> > > >
> >>> > > You change LGTM, but the patch seems not to be applied to HEAD,
> >>> > > I generate the attached v2 using `git format` with some commit
> message.
> >>> > >
> >>> > > --
> >>> > > Regards
> >>> > > Junwang Zhao
> >>> >
> >>> > Hi all!
> >>> > This change looks good to me. However, i have an objection to these
> >>> > lines from v2:
> >>> >
> >>> > > /* Close the forks at smgr level */
> >>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> >>> > > - smgrsw[which].smgr_close(rels[i], forknum);
> >>> > > + smgrclose(rels[i]);
> >>> >
> >>> > Why do we do this? This seems to be an unrelated change given thread
> >>> > $subj. This is just a pure refactoring job, which deserves a separate
> >>> > patch. There is similar coding in
> >>> > smgrdestroy function:
> >>> >
> >>> > ```
> >>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> >>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> >>> > ```
> >>> >
> >>> > So, I feel like these two places should be either changed together or
> >>> > not be altered at all. And is it definitely a separate change.
> >>>
> >>> Yeah, I tend to agree with you, maybe we should split the patch
> >>> into two.
> >>>
> >>> Steven, could you do this?
> >>>
> >>> >
> >>> > --
> >>> > Best regards,
> >>> > Kirill Reshke
> >>>
> >>>
> >>>
> >>> --
> >>> Regards
> >>> Junwang Zhao
>
>
>
> --
> Regards
> Junwang Zhao
>
OK, thanks for your kind help.
Steven
From: | Cary Huang <cary(dot)huang(at)highgo(dot)ca> |
---|---|
To: | pgsql-hackers(at)lists(dot)postgresql(dot)org |
Cc: | Steven Niu <niushiji(at)gmail(dot)com> |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-08-23 21:15:29 |
Message-ID: | 172444772995.382822.12616136179121614869.pgcf@coridan.postgresql.org |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: not tested
Spec compliant: not tested
Documentation: not tested
Hi
the patch looks good to me as well. Calling smgrclose() right after calling smgrdounlinkall() does seem
unnecessary as it is already done inside smgrdounlinkall() as you mentioned. I checked the commit logs
and seems like the code has been like this for over 10 years. One difference is that smgrdounlinkall() does
not reset smgr_cached_nblocks and smgr_targblock but that does not seem to matter as it is about to
remove the physical files.
While leaving them like this does no harm because smgrclose() simply does nothing if the relation has already
been closed, it does look weird that the code tries to close the relation after smgrdounlinkall(), because the
physical files have just been deleted when smgrdounlinkall() completes, and we try to close something that
has been deleted ?!
---------------------------
Cary Huang
Highgo software Canada
www.highgo.ca
From: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2024-10-27 19:05:11 |
Message-ID: | CALdSSPiUD_t6Af6KBQ+-87NSiunGXfFfn63p8LrL34iRC+gVNQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Wed, 14 Aug 2024 at 11:35, Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
> Junwang, Kirill,
>
> The split work has been done. I created a new patch for removing redundant smgrclose() function as attached.
> Please help review it.
>
> Thanks,
> Steven
>
> Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
>>
>> Kirill,
>>
>> Good catch!
>> I will split the patch into two to cover both cases.
>>
>> Thanks,
>> Steven
>>
>>
>> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
>>>
>>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>>> >
>>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>>> > >
>>> > > Hi Steven,
>>> > >
>>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>>> > > >
>>> > > > Hello, hackers,
>>> > > >
>>> > > > I think there may be some duplicated codes.
>>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
>>> > > > But both functions would close SMgrRelation object, it's dupliacted behavior?
>>> > > >
>>> > > > So I make this patch. Could someone take a look at it?
>>> > > >
>>> > > > Thanks for your help,
>>> > > > Steven
>>> > > >
>>> > > > From Highgo.com
>>> > > >
>>> > > >
>>> > > You change LGTM, but the patch seems not to be applied to HEAD,
>>> > > I generate the attached v2 using `git format` with some commit message.
>>> > >
>>> > > --
>>> > > Regards
>>> > > Junwang Zhao
>>> >
>>> > Hi all!
>>> > This change looks good to me. However, i have an objection to these
>>> > lines from v2:
>>> >
>>> > > /* Close the forks at smgr level */
>>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>>> > > - smgrsw[which].smgr_close(rels[i], forknum);
>>> > > + smgrclose(rels[i]);
>>> >
>>> > Why do we do this? This seems to be an unrelated change given thread
>>> > $subj. This is just a pure refactoring job, which deserves a separate
>>> > patch. There is similar coding in
>>> > smgrdestroy function:
>>> >
>>> > ```
>>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
>>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
>>> > ```
>>> >
>>> > So, I feel like these two places should be either changed together or
>>> > not be altered at all. And is it definitely a separate change.
>>>
>>> Yeah, I tend to agree with you, maybe we should split the patch
>>> into two.
>>>
>>> Steven, could you do this?
>>>
>>> >
>>> > --
>>> > Best regards,
>>> > Kirill Reshke
>>>
>>>
>>>
>>> --
>>> Regards
>>> Junwang Zhao
Hi!
Looks like discussion on the subject is completed, and no open items
left, so I will try to mark commitfest [1] entry as Ready For
Committer.
[1] https://commitfest.postgresql.org/50/5149/
--
Best regards,
Kirill Reshke
From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
Cc: | Steven Niu <niushiji(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-08 04:04:19 |
Message-ID: | CAD21AoDz4-ANPRurW=qSAw03pL4f3umPoADLtAuCee0KUmxrgw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi,
On Sun, Oct 27, 2024 at 12:05 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
>
> On Wed, 14 Aug 2024 at 11:35, Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >
> > Junwang, Kirill,
> >
> > The split work has been done. I created a new patch for removing redundant smgrclose() function as attached.
> > Please help review it.
> >
> > Thanks,
> > Steven
> >
> > Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
> >>
> >> Kirill,
> >>
> >> Good catch!
> >> I will split the patch into two to cover both cases.
> >>
> >> Thanks,
> >> Steven
> >>
> >>
> >> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
> >>>
> >>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> >>> >
> >>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> >>> > >
> >>> > > Hi Steven,
> >>> > >
> >>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >>> > > >
> >>> > > > Hello, hackers,
> >>> > > >
> >>> > > > I think there may be some duplicated codes.
> >>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
> >>> > > > But both functions would close SMgrRelation object, it's dupliacted behavior?
> >>> > > >
> >>> > > > So I make this patch. Could someone take a look at it?
> >>> > > >
> >>> > > > Thanks for your help,
> >>> > > > Steven
> >>> > > >
> >>> > > > From Highgo.com
> >>> > > >
> >>> > > >
> >>> > > You change LGTM, but the patch seems not to be applied to HEAD,
> >>> > > I generate the attached v2 using `git format` with some commit message.
> >>> > >
> >>> > > --
> >>> > > Regards
> >>> > > Junwang Zhao
> >>> >
> >>> > Hi all!
> >>> > This change looks good to me. However, i have an objection to these
> >>> > lines from v2:
> >>> >
> >>> > > /* Close the forks at smgr level */
> >>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> >>> > > - smgrsw[which].smgr_close(rels[i], forknum);
> >>> > > + smgrclose(rels[i]);
> >>> >
> >>> > Why do we do this? This seems to be an unrelated change given thread
> >>> > $subj. This is just a pure refactoring job, which deserves a separate
> >>> > patch. There is similar coding in
> >>> > smgrdestroy function:
> >>> >
> >>> > ```
> >>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> >>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> >>> > ```
> >>> >
> >>> > So, I feel like these two places should be either changed together or
> >>> > not be altered at all. And is it definitely a separate change.
> >>>
> >>> Yeah, I tend to agree with you, maybe we should split the patch
> >>> into two.
> >>>
> >>> Steven, could you do this?
> >>>
> >>> >
> >>> > --
> >>> > Best regards,
> >>> > Kirill Reshke
> >>>
> >>>
> >>>
> >>> --
> >>> Regards
> >>> Junwang Zhao
>
> Hi!
> Looks like discussion on the subject is completed, and no open items
> left, so I will try to mark commitfest [1] entry as Ready For
> Committer.
>
I've looked at the patch and have some comments:
The patch removes smgrclose() calls following smgrdounlinkall(), for example:
--- a/src/backend/catalog/storage.c
+++ b/src/backend/catalog/storage.c
@@ -686,9 +686,6 @@ smgrDoPendingDeletes(bool isCommit)
{
smgrdounlinkall(srels, nrels, false);
- for (int i = 0; i < nrels; i++)
- smgrclose(srels[i]);
-
pfree(srels);
}
}
While smgrdounlinkall() close the relation at smgr level as follow:
/* Close the forks at smgr level */
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
smgrsw[which].smgr_close(rels[i], forknum);
smgrrelease(), called by smgrclose(), also does the same thing but
does more things as follow:
void
smgrrelease(SMgrRelation reln)
{
for (ForkNumber forknum = 0; forknum <= MAX_FORKNUM; forknum++)
{
smgrsw[reln->smgr_which].smgr_close(reln, forknum);
reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
}
reln->smgr_targblock = InvalidBlockNumber;
}
Therefore, if we move such smgrclose() calls, we would end up missing
some operations that are done in smgrrelease() but not in
smgrdounlinkall(), no?
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-08 09:05:40 |
Message-ID: | CAEG8a3+AtO5sM22TBALf5ec4gLSzzdi9OWmGJPJvQncPGV9s=Q@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sat, Mar 8, 2025 at 12:04 PM Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> wrote:
>
> Hi,
>
> On Sun, Oct 27, 2024 at 12:05 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> >
> > On Wed, 14 Aug 2024 at 11:35, Steven Niu <niushiji(at)gmail(dot)com> wrote:
> > >
> > > Junwang, Kirill,
> > >
> > > The split work has been done. I created a new patch for removing redundant smgrclose() function as attached.
> > > Please help review it.
> > >
> > > Thanks,
> > > Steven
> > >
> > > Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
> > >>
> > >> Kirill,
> > >>
> > >> Good catch!
> > >> I will split the patch into two to cover both cases.
> > >>
> > >> Thanks,
> > >> Steven
> > >>
> > >>
> > >> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
> > >>>
> > >>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> > >>> >
> > >>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> > >>> > >
> > >>> > > Hi Steven,
> > >>> > >
> > >>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> > >>> > > >
> > >>> > > > Hello, hackers,
> > >>> > > >
> > >>> > > > I think there may be some duplicated codes.
> > >>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall() and smgrclose().
> > >>> > > > But both functions would close SMgrRelation object, it's dupliacted behavior?
> > >>> > > >
> > >>> > > > So I make this patch. Could someone take a look at it?
> > >>> > > >
> > >>> > > > Thanks for your help,
> > >>> > > > Steven
> > >>> > > >
> > >>> > > > From Highgo.com
> > >>> > > >
> > >>> > > >
> > >>> > > You change LGTM, but the patch seems not to be applied to HEAD,
> > >>> > > I generate the attached v2 using `git format` with some commit message.
> > >>> > >
> > >>> > > --
> > >>> > > Regards
> > >>> > > Junwang Zhao
> > >>> >
> > >>> > Hi all!
> > >>> > This change looks good to me. However, i have an objection to these
> > >>> > lines from v2:
> > >>> >
> > >>> > > /* Close the forks at smgr level */
> > >>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > >>> > > - smgrsw[which].smgr_close(rels[i], forknum);
> > >>> > > + smgrclose(rels[i]);
> > >>> >
> > >>> > Why do we do this? This seems to be an unrelated change given thread
> > >>> > $subj. This is just a pure refactoring job, which deserves a separate
> > >>> > patch. There is similar coding in
> > >>> > smgrdestroy function:
> > >>> >
> > >>> > ```
> > >>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > >>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> > >>> > ```
> > >>> >
> > >>> > So, I feel like these two places should be either changed together or
> > >>> > not be altered at all. And is it definitely a separate change.
> > >>>
> > >>> Yeah, I tend to agree with you, maybe we should split the patch
> > >>> into two.
> > >>>
> > >>> Steven, could you do this?
> > >>>
> > >>> >
> > >>> > --
> > >>> > Best regards,
> > >>> > Kirill Reshke
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Regards
> > >>> Junwang Zhao
> >
> > Hi!
> > Looks like discussion on the subject is completed, and no open items
> > left, so I will try to mark commitfest [1] entry as Ready For
> > Committer.
> >
>
> I've looked at the patch and have some comments:
>
> The patch removes smgrclose() calls following smgrdounlinkall(), for example:
>
> --- a/src/backend/catalog/storage.c
> +++ b/src/backend/catalog/storage.c
> @@ -686,9 +686,6 @@ smgrDoPendingDeletes(bool isCommit)
> {
> smgrdounlinkall(srels, nrels, false);
>
> - for (int i = 0; i < nrels; i++)
> - smgrclose(srels[i]);
> -
> pfree(srels);
> }
> }
>
> While smgrdounlinkall() close the relation at smgr level as follow:
>
> /* Close the forks at smgr level */
> for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> smgrsw[which].smgr_close(rels[i], forknum);
>
> smgrrelease(), called by smgrclose(), also does the same thing but
> does more things as follow:.
>
> void
> smgrrelease(SMgrRelation reln)
> {
> for (ForkNumber forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> {
> smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
> }
> reln->smgr_targblock = InvalidBlockNumber;
> }
>
> Therefore, if we move such smgrclose() calls, we would end up missing
> some operations that are done in smgrrelease() but not in
> smgrdounlinkall(), no?
Yeah, we miss setting the smgr_targblock/smgr_cached_nblocks to
InvalidBlockNumber,
but in the smgrDoPendingDeletes case, SMgrRelation are freed after calling
smgrdounlinkall, so I guess it's ok not setting the InvalidBlockNumber?
I did a quick seach of smgrdounlinkall usage, SMgrRelation seems
not needed after the calling of smgrdounlinkall.
>
> Regards,
>
> --
> Masahiko Sawada
> Amazon Web Services: https://aws.amazon.com
--
Regards
Junwang Zhao
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-08 09:37:42 |
Message-ID: | CAEG8a3K+a0901qWOOOMmd2VxUTfe_awajRw8oYvTtUz-B+YsTQ@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hi Masahiko,
> > I've looked at the patch and have some comments:
> >
> > The patch removes smgrclose() calls following smgrdounlinkall(), for example:
> >
> > --- a/src/backend/catalog/storage.c
> > +++ b/src/backend/catalog/storage.c
> > @@ -686,9 +686,6 @@ smgrDoPendingDeletes(bool isCommit)
> > {
> > smgrdounlinkall(srels, nrels, false);
> >
> > - for (int i = 0; i < nrels; i++)
> > - smgrclose(srels[i]);
> > -
> > pfree(srels);
> > }
> > }
> >
> > While smgrdounlinkall() close the relation at smgr level as follow:
> >
> > /* Close the forks at smgr level */
> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > smgrsw[which].smgr_close(rels[i], forknum);
> >
> > smgrrelease(), called by smgrclose(), also does the same thing but
> > does more things as follow:.
> >
> > void
> > smgrrelease(SMgrRelation reln)
> > {
> > for (ForkNumber forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > {
> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> > reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
> > }
> > reln->smgr_targblock = InvalidBlockNumber;
> > }
> >
> > Therefore, if we move such smgrclose() calls, we would end up missing
> > some operations that are done in smgrrelease() but not in
> > smgrdounlinkall(), no?
>
> Yeah, we miss setting the smgr_targblock/smgr_cached_nblocks to
> InvalidBlockNumber,
> but in the smgrDoPendingDeletes case, SMgrRelation are freed after calling
> smgrdounlinkall, so I guess it's ok not setting the InvalidBlockNumber?
>
> I did a quick seach of smgrdounlinkall usage, SMgrRelation seems
> not needed after the calling of smgrdounlinkall.
>
After a second look, I realize I'm wrong, it's that the pointers to SMgrRelation
are freed, not the SMgrRelation itself.
So I agree with you that we would end up missing some operations with
this patch.
> >
> > Regards,
> >
> > --
> > Masahiko Sawada
> > Amazon Web Services: https://aws.amazon.com
>
>
>
> --
> Regards
> Junwang Zhao
--
Regards
Junwang Zhao
From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-08 09:45:58 |
Message-ID: | CAD21AoBq8mHiJ9feBef561OxQ6OrTtXuzdNRfw31yYpZYLWoZw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sat, Mar 8, 2025 at 1:37 AM Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
>
> Hi Masahiko,
>
> > > I've looked at the patch and have some comments:
> > >
> > > The patch removes smgrclose() calls following smgrdounlinkall(), for example:
> > >
> > > --- a/src/backend/catalog/storage.c
> > > +++ b/src/backend/catalog/storage.c
> > > @@ -686,9 +686,6 @@ smgrDoPendingDeletes(bool isCommit)
> > > {
> > > smgrdounlinkall(srels, nrels, false);
> > >
> > > - for (int i = 0; i < nrels; i++)
> > > - smgrclose(srels[i]);
> > > -
> > > pfree(srels);
> > > }
> > > }
> > >
> > > While smgrdounlinkall() close the relation at smgr level as follow:
> > >
> > > /* Close the forks at smgr level */
> > > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > > smgrsw[which].smgr_close(rels[i], forknum);
> > >
> > > smgrrelease(), called by smgrclose(), also does the same thing but
> > > does more things as follow:.
> > >
> > > void
> > > smgrrelease(SMgrRelation reln)
> > > {
> > > for (ForkNumber forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > > {
> > > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> > > reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
> > > }
> > > reln->smgr_targblock = InvalidBlockNumber;
> > > }
> > >
> > > Therefore, if we move such smgrclose() calls, we would end up missing
> > > some operations that are done in smgrrelease() but not in
> > > smgrdounlinkall(), no?
> >
> > Yeah, we miss setting the smgr_targblock/smgr_cached_nblocks to
> > InvalidBlockNumber,
> > but in the smgrDoPendingDeletes case, SMgrRelation are freed after calling
> > smgrdounlinkall, so I guess it's ok not setting the InvalidBlockNumber?
> >
> > I did a quick seach of smgrdounlinkall usage, SMgrRelation seems
> > not needed after the calling of smgrdounlinkall.
> >
>
> After a second look, I realize I'm wrong, it's that the pointers to SMgrRelation
> are freed, not the SMgrRelation itself.
>
> So I agree with you that we would end up missing some operations with
> this patch.
Right. Also, I'm concerned that even if we could remove these
smgrclose() calls the benefit of removing these calls here would be
very small compared to the risk of changing the code.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-10 10:07:34 |
Message-ID: | CABBtG=fP-t2cnrinURxTGa6__uu1fGEegk5Bh1vt8fxsJ9rOCw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> 于2025年3月8日周六 12:04写道:
> Hi,
>
> On Sun, Oct 27, 2024 at 12:05 PM Kirill Reshke <reshkekirill(at)gmail(dot)com>
> wrote:
> >
> > On Wed, 14 Aug 2024 at 11:35, Steven Niu <niushiji(at)gmail(dot)com> wrote:
> > >
> > > Junwang, Kirill,
> > >
> > > The split work has been done. I created a new patch for removing
> redundant smgrclose() function as attached.
> > > Please help review it.
> > >
> > > Thanks,
> > > Steven
> > >
> > > Steven Niu <niushiji(at)gmail(dot)com> 于2024年8月12日周一 18:11写道:
> > >>
> > >> Kirill,
> > >>
> > >> Good catch!
> > >> I will split the patch into two to cover both cases.
> > >>
> > >> Thanks,
> > >> Steven
> > >>
> > >>
> > >> Junwang Zhao <zhjwpku(at)gmail(dot)com> 于2024年8月9日周五 18:19写道:
> > >>>
> > >>> On Fri, Aug 9, 2024 at 5:20 PM Kirill Reshke <reshkekirill(at)gmail(dot)com>
> wrote:
> > >>> >
> > >>> > On Thu, 1 Aug 2024 at 17:32, Junwang Zhao <zhjwpku(at)gmail(dot)com>
> wrote:
> > >>> > >
> > >>> > > Hi Steven,
> > >>> > >
> > >>> > > On Wed, Jul 31, 2024 at 11:16 AM Steven Niu <niushiji(at)gmail(dot)com>
> wrote:
> > >>> > > >
> > >>> > > > Hello, hackers,
> > >>> > > >
> > >>> > > > I think there may be some duplicated codes.
> > >>> > > > Function smgrDoPendingDeletes() calls both smgrdounlinkall()
> and smgrclose().
> > >>> > > > But both functions would close SMgrRelation object, it's
> dupliacted behavior?
> > >>> > > >
> > >>> > > > So I make this patch. Could someone take a look at it?
> > >>> > > >
> > >>> > > > Thanks for your help,
> > >>> > > > Steven
> > >>> > > >
> > >>> > > > From Highgo.com
> > >>> > > >
> > >>> > > >
> > >>> > > You change LGTM, but the patch seems not to be applied to HEAD,
> > >>> > > I generate the attached v2 using `git format` with some commit
> message.
> > >>> > >
> > >>> > > --
> > >>> > > Regards
> > >>> > > Junwang Zhao
> > >>> >
> > >>> > Hi all!
> > >>> > This change looks good to me. However, i have an objection to these
> > >>> > lines from v2:
> > >>> >
> > >>> > > /* Close the forks at smgr level */
> > >>> > > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > >>> > > - smgrsw[which].smgr_close(rels[i], forknum);
> > >>> > > + smgrclose(rels[i]);
> > >>> >
> > >>> > Why do we do this? This seems to be an unrelated change given
> thread
> > >>> > $subj. This is just a pure refactoring job, which deserves a
> separate
> > >>> > patch. There is similar coding in
> > >>> > smgrdestroy function:
> > >>> >
> > >>> > ```
> > >>> > for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > >>> > smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> > >>> > ```
> > >>> >
> > >>> > So, I feel like these two places should be either changed together
> or
> > >>> > not be altered at all. And is it definitely a separate change.
> > >>>
> > >>> Yeah, I tend to agree with you, maybe we should split the patch
> > >>> into two.
> > >>>
> > >>> Steven, could you do this?
> > >>>
> > >>> >
> > >>> > --
> > >>> > Best regards,
> > >>> > Kirill Reshke
> > >>>
> > >>>
> > >>>
> > >>> --
> > >>> Regards
> > >>> Junwang Zhao
> >
> > Hi!
> > Looks like discussion on the subject is completed, and no open items
> > left, so I will try to mark commitfest [1] entry as Ready For
> > Committer.
> >
>
> I've looked at the patch and have some comments:
>
> The patch removes smgrclose() calls following smgrdounlinkall(), for
> example:
>
> --- a/src/backend/catalog/storage.c
> +++ b/src/backend/catalog/storage.c
> @@ -686,9 +686,6 @@ smgrDoPendingDeletes(bool isCommit)
> {
> smgrdounlinkall(srels, nrels, false);
>
> - for (int i = 0; i < nrels; i++)
> - smgrclose(srels[i]);
> -
> pfree(srels);
> }
> }
>
> While smgrdounlinkall() close the relation at smgr level as follow:
>
> /* Close the forks at smgr level */
> for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> smgrsw[which].smgr_close(rels[i], forknum);
>
> smgrrelease(), called by smgrclose(), also does the same thing but
> does more things as follow:
>
> void
> smgrrelease(SMgrRelation reln)
> {
> for (ForkNumber forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> {
> smgrsw[reln->smgr_which].smgr_close(reln, forknum);
> reln->smgr_cached_nblocks[forknum] = InvalidBlockNumber;
> }
> reln->smgr_targblock = InvalidBlockNumber;
> }
>
> Therefore, if we move such smgrclose() calls, we would end up missing
> some operations that are done in smgrrelease() but not in
> smgrdounlinkall(), no?
>
> Regards,
>
> --
> Masahiko Sawada
> Amazon Web Services: https://aws.amazon.com
Hi, Masahiko
Thanks for your comments! I understand your concern as you stated.
However, my initial patch was split into two parts as Kirill suggested.
This thread is about the first part. Another part is here:
https://commitfest.postgresql.org/patch/5149/
Or you can take a look at the v2-0001-remove-duplicated-smgrclose.patch
<https://www.postgresql.org/message-id/attachment/163268/v2-0001-remove-duplicated-smgrclose.patch>
in
this thread for the complete change.
I think either we review the v2-patch, or review the both 5149 and 5196
CFs, for my complete change.
There should be no missing operations.
Please let me know if you have more comments.
Best Regards,
Steven
From: | Junwang Zhao <zhjwpku(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-11 01:38:13 |
Message-ID: | CAEG8a3JSfpyKPEiJ7fsxuhxh3oCSMLW2=P9HZ5LWEiNEoyRkKw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
>
> Hi, Masahiko
>
> Thanks for your comments! I understand your concern as you stated.
> However, my initial patch was split into two parts as Kirill suggested.
> This thread is about the first part. Another part is here: https://commitfest.postgresql.org/patch/5149/
> Or you can take a look at the v2-0001-remove-duplicated-smgrclose.patch in this thread for the complete change.
>
> I think either we review the v2-patch, or review the both 5149 and 5196 CFs, for my complete change.
> There should be no missing operations.
@@ -482,13 +482,11 @@ smgrdounlinkall(SMgrRelation *rels, int nrels,
bool isRedo)
for (i = 0; i < nrels; i++)
{
RelFileLocatorBackend rlocator = rels[i]->smgr_rlocator;
- int which = rels[i]->smgr_which;
rlocators[i] = rlocator;
/* Close the forks at smgr level */
- for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
- smgrsw[which].smgr_close(rels[i], forknum);
+ smgrclose(rels[i]);
}
Yeah, you are adjusting the behavior by moving the `smgrclose` operation
after the `smgrdounlinkall` to the `smgrdounlinkall` function itself.
Seems no missing operations in v2-patch. Thanks.
>
> Please let me know if you have more comments.
>
> Best Regards,
> Steven
--
Regards
Junwang Zhao
From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-11 22:31:42 |
Message-ID: | CAD21AoC2X28aP8jZt29NKomb=qcdjZrZNp+jXZQx6oj3pFoxnA@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Mon, Mar 10, 2025 at 3:08 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
>
>
> Hi, Masahiko
>
> Thanks for your comments! I understand your concern as you stated.
> However, my initial patch was split into two parts as Kirill suggested.
> This thread is about the first part. Another part is here: https://commitfest.postgresql.org/patch/5149/
> Or you can take a look at the v2-0001-remove-duplicated-smgrclose.patch in this thread for the complete change.
>
> I think either we review the v2-patch, or review the both 5149 and 5196 CFs, for my complete change.
> There should be no missing operations.
>
> Please let me know if you have more comments.
What is the main point of removing these duplication? While I can see
that in smgrDoPendingDeletes(), we do
'smgrsw[reln->smgr_which].smgr_close(reln, forknum);' twice for each
relation: in smgrdounlinkall() and in smgrrelease(), I'm not sure what
this change benefits to us. Particularly, we quick return from the
second mdclose() call as all segment files are already closed. Have
you experienced a case like where the system got stuck or got very
slower due to these duplicated calls?
Also, we might need to pay attention that with the patch
smgrdounlinkall() came to depend on smgrclose(). For example, the more
works we add in smgrclose() in the future, the more works
smgrdounlinkall() will do, which doesn't happen with the current code
as smgrdounlinkall() depends on mdclose().
Given that the patched codes doesn't do exactly the same things as
before (e.g, smgrdounlinkall() would end up resetting
reln->smgr_cached_nblocks[forknum] too), I think we need some reasons
for legitimating this change.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
From: | Steven Niu <niushiji(at)gmail(dot)com> |
---|---|
To: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-13 08:36:58 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
在 2025/3/12 6:31, Masahiko Sawada 写道:
> On Mon, Mar 10, 2025 at 3:08 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>>
>>
>>
>> Hi, Masahiko
>>
>> Thanks for your comments! I understand your concern as you stated.
>> However, my initial patch was split into two parts as Kirill suggested.
>> This thread is about the first part. Another part is here: https://commitfest.postgresql.org/patch/5149/
>> Or you can take a look at the v2-0001-remove-duplicated-smgrclose.patch in this thread for the complete change.
>>
>> I think either we review the v2-patch, or review the both 5149 and 5196 CFs, for my complete change.
>> There should be no missing operations.
>>
>> Please let me know if you have more comments.
>
> What is the main point of removing these duplication? While I can see
> that in smgrDoPendingDeletes(), we do
> 'smgrsw[reln->smgr_which].smgr_close(reln, forknum);' twice for each
> relation: in smgrdounlinkall() and in smgrrelease(), I'm not sure what
> this change benefits to us. Particularly, we quick return from the
> second mdclose() call as all segment files are already closed. Have
> you experienced a case like where the system got stuck or got very
> slower due to these duplicated calls?
>
> Also, we might need to pay attention that with the patch
> smgrdounlinkall() came to depend on smgrclose(). For example, the more
> works we add in smgrclose() in the future, the more works
> smgrdounlinkall() will do, which doesn't happen with the current code
> as smgrdounlinkall() depends on mdclose().
>
> Given that the patched codes doesn't do exactly the same things as
> before (e.g, smgrdounlinkall() would end up resetting
> reln->smgr_cached_nblocks[forknum] too), I think we need some reasons
> for legitimating this change.
>
> Regards,
>
Hi, Masahiko
Thank you for your detailed review and valuable insights. I understand
your concern about the immediate benefits of removing the duplicate
smgr_close() call, especially since the second call effectively becomes
a no-op due to the prior file closures. However, the primary intent of
my change is not driven by performance improvements or addressing a
specific issue, but rather by enhancing the code's structure and
clarity. Having two "Close the forks at smgr level" operations might
lead to confusion for readers of the code.
Additionally, the smgrclose() function not only closes the smgr but also
resets smgr_cached_nblocks and smgr_targblock, making it a comprehensive
operation. In the current implementation, the smgr is closed inside
smgrdounlinkall(), while smgr_cached_nblocks and smgr_targblock are
reset outside of it. This creates a fragmentation in the code logic,
which could be streamlined.
Would it make sense to remove the smgr closing operation within
smgrdounlinkall() and leave the rest of the code unchanged? This
approach would eliminate the duplication while ensuring no operations
are missed. I'd appreciate your thoughts on this suggestion.
Thanks,
Steven
From: | Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com> |
---|---|
To: | Steven Niu <niushiji(at)gmail(dot)com> |
Cc: | Kirill Reshke <reshkekirill(at)gmail(dot)com>, Junwang Zhao <zhjwpku(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-03-26 05:43:05 |
Message-ID: | CAD21AoBLePJO5NtDoZWRxprCOtauMFr6Uaj4V8FxWJ1rKeyZFw@mail.gmail.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Thu, Mar 13, 2025 at 1:37 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
>
>
>
> 在 2025/3/12 6:31, Masahiko Sawada 写道:
> > On Mon, Mar 10, 2025 at 3:08 AM Steven Niu <niushiji(at)gmail(dot)com> wrote:
> >>
> >>
> >>
> >> Hi, Masahiko
> >>
> >> Thanks for your comments! I understand your concern as you stated.
> >> However, my initial patch was split into two parts as Kirill suggested.
> >> This thread is about the first part. Another part is here: https://commitfest.postgresql.org/patch/5149/
> >> Or you can take a look at the v2-0001-remove-duplicated-smgrclose.patch in this thread for the complete change.
> >>
> >> I think either we review the v2-patch, or review the both 5149 and 5196 CFs, for my complete change.
> >> There should be no missing operations.
> >>
> >> Please let me know if you have more comments.
> >
> > What is the main point of removing these duplication? While I can see
> > that in smgrDoPendingDeletes(), we do
> > 'smgrsw[reln->smgr_which].smgr_close(reln, forknum);' twice for each
> > relation: in smgrdounlinkall() and in smgrrelease(), I'm not sure what
> > this change benefits to us. Particularly, we quick return from the
> > second mdclose() call as all segment files are already closed. Have
> > you experienced a case like where the system got stuck or got very
> > slower due to these duplicated calls?
> >
> > Also, we might need to pay attention that with the patch
> > smgrdounlinkall() came to depend on smgrclose(). For example, the more
> > works we add in smgrclose() in the future, the more works
> > smgrdounlinkall() will do, which doesn't happen with the current code
> > as smgrdounlinkall() depends on mdclose().
> >
> > Given that the patched codes doesn't do exactly the same things as
> > before (e.g, smgrdounlinkall() would end up resetting
> > reln->smgr_cached_nblocks[forknum] too), I think we need some reasons
> > for legitimating this change.
> >
> > Regards,
> >
>
>
> Hi, Masahiko
>
> Thank you for your detailed review and valuable insights. I understand
> your concern about the immediate benefits of removing the duplicate
> smgr_close() call, especially since the second call effectively becomes
> a no-op due to the prior file closures. However, the primary intent of
> my change is not driven by performance improvements or addressing a
> specific issue, but rather by enhancing the code's structure and
> clarity. Having two "Close the forks at smgr level" operations might
> lead to confusion for readers of the code.
>
>
> Additionally, the smgrclose() function not only closes the smgr but also
> resets smgr_cached_nblocks and smgr_targblock, making it a comprehensive
> operation. In the current implementation, the smgr is closed inside
> smgrdounlinkall(), while smgr_cached_nblocks and smgr_targblock are
> reset outside of it. This creates a fragmentation in the code logic,
> which could be streamlined.
I've investigated the code further. It seems like smgrclose() became
just an alias of smgrrelease() by commit 21d9c3ee4ef, making the
duplications of calling mdclose() for each relation and its fork by
smgrclose() and smgrunlinkall(). I'm hesitant with the first proposal
of removing smgrclose() calls following smgrunlinkall() because, as
you also pointed out, we would miss some operations (e.g. resetting
smgr_cached_nblocks), and it would create another coding convention
that we can omit smgrclose() only after smgrunlinkall(), causing the
code divergences, which might introduce another confusion.
> Would it make sense to remove the smgr closing operation within
> smgrdounlinkall() and leave the rest of the code unchanged?
If I understand your idea correctly, smgrdounlinkall() would end up
calling mdunlink() for each relation without mdclose(). I don't think
it's okay.
Regards,
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
From: | Álvaro Herrera <alvherre(at)kurilemu(dot)de> |
---|---|
To: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
Cc: | Junwang Zhao <zhjwpku(at)gmail(dot)com>, Steven Niu <niushiji(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
Subject: | Re: [Patch] remove duplicated smgrclose |
Date: | 2025-08-05 19:49:51 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Lists: | pgsql-hackers |
Hello,
On 2024-Aug-09, Kirill Reshke wrote:
> Hi all!
> This change looks good to me. However, i have an objection to these
> lines from v2:
>
> > /* Close the forks at smgr level */
> > - for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
> > - smgrsw[which].smgr_close(rels[i], forknum);
> > + smgrclose(rels[i]);
>
> Why do we do this?
I want to say that this does not appear to be to be an objection. I
think it was just a question. An objection implies that you consider a
change to be incorrect or detrimental, and therefore it should not be
made. In this case, by posing your question in this way:
> This seems to be an unrelated change given thread
> $subj. This is just a pure refactoring job, which deserves a separate
> patch. There is similar coding in
> smgrdestroy function:
[...]
> So, I feel like these two places should be either changed together or
> not be altered at all. And is it definitely a separate change.
... the patch was derailed and we ended up not doing anything at all,
and worse, we ended up with a separate thread doing something closely
related but in a way that appears unconnected to this thread. (Worse,
Steven forgot to open a commitfest entry for it, so the patch was lost
in the perpetual pgsql-hackers background noise). I think Masahiko
rejected this patch because it was incorrect without that other patch,
or something like that.
I've marked this[2] entry as returned with feedback now. I would
suggest to Steven to propose this patch again, but this time as a single
patch that does the complete change rather than half here and half
there, keeping Masahiko's closing comments[3] in mind. Once he has such
a patch, he can reopen this commitfest entry as Needs Review (moving it
to whatever the open commitfest is.)
Thanks
[1] https://postgr.es/m/CABBtG=d1Kkmi67VdM=jGaYkQ0+WGbhZpxwa3ms0s1DB_J_9Jww@mail.gmail.com
[2] https://commitfest.postgresql.org/patch/5149/
[3] https://postgr.es/m/CAD21AoBLePJO5NtDoZWRxprCOtauMFr6Uaj4V8FxWJ1rKeyZFw@mail.gmail.com
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Thou shalt study thy libraries and strive not to reinvent them without
cause, that thy code may be short and readable and thy days pleasant
and productive. (7th Commandment for C Programmers)