Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-14 Thread Evgeny
Hello Hackers! > I think this is going too far. The new function BootStrapSlruPage() now > is being used for things other than bootstrapping, and that doesn't seem > appropriate to me. I think we should leave the things that aren't > bootstrap out of this patch. For instance, ExtendCLOG was mo

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-13 Thread Álvaro Herrera
Hello I think this is going too far. The new function BootStrapSlruPage() now is being used for things other than bootstrapping, and that doesn't seem appropriate to me. I think we should leave the things that aren't bootstrap out of this patch. For instance, ExtendCLOG was more understandable

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-12 Thread Andrey Borodin
> On 12 Mar 2025, at 20:02, Evgeny Voropaev wrote: > v6 looks good to me. I'll flip the CF entry. Thanks! Best regards, Andrey Borodin.

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-12 Thread Evgeny Voropaev
Hello Hackers! Andrey, thank you for your review and remarks. > Patch adds whitespace errors Cleaned. > if (writePage != 0) should be if (writePage) Done. > XLogSimpleInsert(int64 simpledata, RmgrId rmid, uint8 info) > I’d rename function XLogSimpleInsert() to something more descriptive > and

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-11 Thread Andrey Borodin
> On 11 Mar 2025, at 14:12, Evgeny wrote: > Hi! Some nits: Patch adds whitespace errors .git/rebase-apply/patch:64: trailing whitespace. * Nullify the page (pageno = 0), don't insert an XLog record, .git/rebase-apply/patch:212: trailing whitespace. /* .git/rebase-apply/patch:213: traili

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-11 Thread Evgeny
Hello Hackers! On 11 March 2025, the CI job failed (https://cirrus-ci.com/task/5453963400577024). The issue occurred in the test ‘pg_amcheck/t/002_nonesuch.pl . Log: https://api.cirrus-ci.com/v1/artifact/task/5453963400577024/testrun/build/testrun/pg_amcheck/002_nonesuch/log/regress_log_002

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-03-04 Thread Evgeny
Hello Hackers! Álvaro, Andrey, Aleksander! We have not been discussing anything in the thread for the past ten days. Can we mark this thread as "Ready for Merge" or should I improve something in the patch. If I should, I am ready to do it. Looking forward to your feedback. Evgeny Voropaev.

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-23 Thread Evgeny
Hello hackers! > I think the overall idea here is good, but I didn't like the new > WriteSlruZeroPageXlogRec helper function; it looks too much like a > modularity violation (same for the fact that you have to pass the rmid > and info from each caller into slru.c). I would not do that in slru.c >

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-22 Thread Álvaro Herrera
On 2025-Feb-18, Evgeny Voropaev wrote: > Created functions BootStrapSlruPage,SimpleLruZeroAndLogPage, > WriteSlruZeroPageXlogRec. Using of these functions allows to delete > ZeroXYZPage functions, WriteXYZZeroPageXlogRec functions and eliminate code > repetitions. I think the overall idea here is

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-18 Thread Evgeny Voropaev
On 17.02.2025 21:00, Álvaro Herrera wrote: On 2025-Feb-17, Andrey Borodin wrote: BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument false. In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage, ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage, ZeroSUBT

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-17 Thread Álvaro Herrera
On 2025-Feb-17, Andrey Borodin wrote: > BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument > false. > In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage, > ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage, ZeroSUBTRANSPage) it > means just a call to Simp

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-17 Thread Andrey Borodin
> On 14 Feb 2025, at 11:54, Evgeny Voropaev > wrote: > > Hi! Nice patch! BootStrapSlruPage() always calls zerofunc(pageno, false) with second argument false. In case of every possible argument (ZeroCLOGPage, ZeroCommitTsPage, ZeroMultiXactOffsetPage, ZeroMultiXactMemberPage, ZeroSUBTRANS

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Evgeny Voropaev
Hello Aleksander! Hello Álvaro! Thank you for your attention to the patch. Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to me that it merely wastes space in SlruCtlData. On top of that I'm not 100% sure if all the supported platforms have C99 compilers with designated init

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Aleksander Alekseev
Hi Alvaro, > > Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to > > me that it merely wastes space in SlruCtlData. On top of that I'm not > > 100% sure if all the supported platforms have C99 compilers with > > designated initializers support. > > They do -- we use them quite

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Álvaro Herrera
On 2025-Feb-13, Aleksander Alekseev wrote: > Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to > me that it merely wastes space in SlruCtlData. On top of that I'm not > 100% sure if all the supported platforms have C99 compilers with > designated initializers support. They do

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Aleksander Alekseev
Hi Evgeny, > The functions, bootstrapping SLRU pages, such as BootStrapMultiXact, > BootStrapCLOG, ActivateCommitTs, multixact_redo and others, have a lot > of repetitive code. > > A new proposed function BootStrapSlruPage moves a duplicating code into > the single place. Additionally, a new membe