Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Date: 2020-04-27 10:34:55
Message-ID: CAFiTN-vnnrk580ucZVYnub_UQ-ayROew8fQ2Yn5aFYMeF0U03w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 17, 2020 at 1:40 AM Kuntal Ghosh <kuntalghosh(dot)2007(at)gmail(dot)com> wrote:
>
> On Tue, Apr 14, 2020 at 3:41 PM Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
> >
>
> Few review comments from 0006-Add-support-for-streaming*.patch
>
> + subxacts[nsubxacts].offset = lseek(stream_fd, 0, SEEK_END);
> lseek can return (-)ve value in case of error, right?
>
> + /*
> + * We might need to create the tablespace's tempfile directory, if no
> + * one has yet done so.
> + *
> + * Don't check for error from mkdir; it could fail if the directory
> + * already exists (maybe someone else just did the same thing). If
> + * it doesn't work then we'll bomb out when opening the file
> + */
> + mkdir(tempdirpath, S_IRWXU);
> If that's the only reason, perhaps we can use something like following:
>
> if (mkdir(tempdirpath, S_IRWXU) < 0 && errno != EEXIST)
> throw error;

Done

>
> +
> + CloseTransientFile(stream_fd);
> Might failed to close the file. We should handle the case.

Changed

Still, one place is pending because I don't have the filename there to
report an error. One option is we can just give an error without the
filename. I will try to think about this part.

> Also, I think we need some implementations in dumpSubscription() to
> dump the (streaming = 'on') option.

Right, created another patch and attached.

I have also fixed a couple of bugs internally reported by my colleague
Neha Sharma.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v16-0002-Issue-individual-invalidations-with-wal_level-lo.patch application/octet-stream 16.7 KB
v16-0001-Immediately-WAL-log-assignments.patch application/octet-stream 10.5 KB
v16-0003-Extend-the-output-plugin-API-with-stream-methods.patch application/octet-stream 34.8 KB
v16-0004-Gracefully-handle-concurrent-aborts-of-uncommitt.patch application/octet-stream 12.3 KB
v16-0005-Implement-streaming-mode-in-ReorderBuffer.patch application/octet-stream 38.0 KB
v16-0009-Add-TAP-test-for-streaming-vs.-DDL.patch application/octet-stream 4.4 KB
v16-0006-Add-support-for-streaming-to-built-in-replicatio.patch application/octet-stream 91.3 KB
v16-0007-Track-statistics-for-streaming.patch application/octet-stream 11.7 KB
v16-0008-Enable-streaming-for-all-subscription-TAP-tests.patch application/octet-stream 14.7 KB
v16-0010-Bugfix-handling-of-incomplete-toast-tuple.patch application/octet-stream 15.3 KB
v16-0012-Add-streaming-option-in-pg_dump.patch application/octet-stream 2.7 KB
v16-0011-Provide-new-api-to-get-the-streaming-changes.patch application/octet-stream 4.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jehan-Guillaume de Rorthais 2020-04-27 10:42:47 Re: [BUG] non archived WAL removed during production crash recovery
Previous Message 曾文旌 2020-04-27 09:49:10 Re: [Proposal] Global temporary tables