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

2020-01-30 Thread Dilip Kumar
On Thu, Jan 30, 2020 at 4:11 PM Amit Kapila wrote: > > On Fri, Jan 10, 2020 at 10:14 AM Dilip Kumar wrote: > > > > On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila wrote: > > > > > > > > > > > Few more comments: > > > > > > v4-0007-Implement-streaming-mode-in-ReorderBu

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

2020-01-30 Thread Amit Kapila
On Fri, Jan 10, 2020 at 10:14 AM Dilip Kumar wrote: > > On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila wrote: > > > > > > > Few more comments: > > > > v4-0007-Implement-streaming-mode-in-ReorderBuffer > > 1. > > +ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBuffer

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

2020-01-28 Thread Amit Kapila
On Tue, Jan 28, 2020 at 1:55 PM Dilip Kumar wrote: > > On Tue, Jan 28, 2020 at 1:30 PM Amit Kapila wrote: > > > > On Tue, Jan 28, 2020 at 11:58 AM Dilip Kumar wrote: > > > > > > On Tue, Jan 28, 2020 at 11:43 AM Amit Kapila > > > wrote: > > > > > > > > > > It seems to me that we need to add all

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

2020-01-28 Thread Dilip Kumar
On Tue, Jan 28, 2020 at 1:30 PM Amit Kapila wrote: > > On Tue, Jan 28, 2020 at 11:58 AM Dilip Kumar wrote: > > > > On Tue, Jan 28, 2020 at 11:43 AM Amit Kapila > > wrote: > > > > > > > > It seems to me that we need to add all of this new handling because > > > > > while taking the decision whet

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

2020-01-28 Thread Amit Kapila
On Tue, Jan 28, 2020 at 11:58 AM Dilip Kumar wrote: > > On Tue, Jan 28, 2020 at 11:43 AM Amit Kapila wrote: > > > > > > It seems to me that we need to add all of this new handling because > > > > while taking the decision whether to stream or not we don't know > > > > whether the txn has changes

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

2020-01-27 Thread Dilip Kumar
On Tue, Jan 28, 2020 at 11:43 AM Amit Kapila wrote: > > On Tue, Jan 28, 2020 at 11:34 AM Dilip Kumar wrote: > > > > On Tue, Jan 28, 2020 at 11:28 AM Amit Kapila > > wrote: > > > > > > On Wed, Jan 22, 2020 at 10:30 AM Dilip Kumar > > > wrote: > > > > > > > > On Tue, Jan 14, 2020 at 10:44 AM Am

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

2020-01-27 Thread Amit Kapila
On Tue, Jan 28, 2020 at 11:34 AM Dilip Kumar wrote: > > On Tue, Jan 28, 2020 at 11:28 AM Amit Kapila wrote: > > > > On Wed, Jan 22, 2020 at 10:30 AM Dilip Kumar wrote: > > > > > > On Tue, Jan 14, 2020 at 10:44 AM Amit Kapila > > > wrote: > > > > > > > > > > > > Hmm, I think this can turn out t

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

2020-01-27 Thread Dilip Kumar
On Tue, Jan 28, 2020 at 11:28 AM Amit Kapila wrote: > > On Wed, Jan 22, 2020 at 10:30 AM Dilip Kumar wrote: > > > > On Tue, Jan 14, 2020 at 10:44 AM Amit Kapila > > wrote: > > > > > > > > > Hmm, I think this can turn out to be inefficient because we can easily > > > end up spilling the data eve

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

2020-01-27 Thread Amit Kapila
On Wed, Jan 22, 2020 at 10:30 AM Dilip Kumar wrote: > > On Tue, Jan 14, 2020 at 10:44 AM Amit Kapila wrote: > > > > > > Hmm, I think this can turn out to be inefficient because we can easily > > end up spilling the data even when we don't need to so. Consider > > cases, where part of the streame

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

2020-01-22 Thread Amit Kapila
On Wed, Jan 22, 2020 at 10:07 PM Alvaro Herrera wrote: > > I looked at this patchset and it seemed natural to apply 0008 next > (adding work_mem to subscriptions). > I am not so sure whether we need this patch as the exact scenario where it can help is not very clear to me and neither did anyone

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

2020-01-22 Thread Alvaro Herrera
I looked at this patchset and it seemed natural to apply 0008 next (adding work_mem to subscriptions). Attached is Dilip's latest version, plus my review changes. This will break the patch tester's logic; sorry about that. What part of this change is what sets the process's logical_decoding_work

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

2020-01-21 Thread Dilip Kumar
On Sat, Jan 4, 2020 at 4:07 PM Amit Kapila wrote: > Update on the open items > As per my understanding apart from the above comments, the known > pending work for this patchset is as follows: > a. The two open items agreed to you in the email [3]. -> The first part is > done and the second part

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

2020-01-21 Thread Tomas Vondra
On Tue, Jan 14, 2020 at 10:56:37AM +0530, Dilip Kumar wrote: On Sat, Jan 11, 2020 at 3:07 AM Alvaro Herrera wrote: On 2020-Jan-10, Alvaro Herrera wrote: > Here's a rebase of this patch series. I didn't change anything except ... this time with attachments ... The patch set fails to apply o

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

2020-01-13 Thread Amit Kapila
On Mon, Jan 13, 2020 at 3:18 PM Dilip Kumar wrote: > > On Thu, Jan 9, 2020 at 12:09 PM Amit Kapila wrote: > > > > On Thu, Jan 9, 2020 at 10:30 AM Dilip Kumar wrote: > > > > > > On Thu, Jan 9, 2020 at 9:35 AM Amit Kapila > > > wrote: > > > > > > > > > The problem is that when we > > > > > get

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

2020-01-13 Thread Dilip Kumar
On Thu, Jan 9, 2020 at 12:09 PM Amit Kapila wrote: > > On Thu, Jan 9, 2020 at 10:30 AM Dilip Kumar wrote: > > > > On Thu, Jan 9, 2020 at 9:35 AM Amit Kapila wrote: > > > > > > On Wed, Jan 8, 2020 at 1:12 PM Dilip Kumar wrote: > > > > > > > > I have observed one more design issue. > > > > > > >

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

2020-01-10 Thread Alvaro Herrera
On 2020-Jan-10, Alvaro Herrera wrote: > From 7d671806584fff71067c8bde38b2f642ba1331a9 Mon Sep 17 00:00:00 2001 > From: Dilip Kumar > Date: Wed, 20 Nov 2019 16:41:13 +0530 > Subject: [PATCH v6 10/12] Enable streaming for all subscription TAP tests This patch turns a lot of test into the streamed

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

2020-01-10 Thread Alvaro Herrera
Here's a rebase of this patch series. I didn't change anything except 1. disregard what was 0005, since I already pushed it. 2. roll 0003 into 0002. 3. rebase 0007 (now 0005) to account for the reorderbuffer changes. (I did notice that 0005 adds a new boolean any_data_sent, which is silly -- it

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

2020-01-10 Thread Alvaro Herrera
I pushed 0005 (the rbtxn flags thing) after some light editing. It's been around for long enough ... -- Álvaro Herrerahttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

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

2020-01-09 Thread Dilip Kumar
On Mon, Dec 30, 2019 at 3:43 PM Amit Kapila wrote: > > On Sun, Dec 29, 2019 at 1:34 PM Dilip Kumar wrote: > > > > I have observed some more issues > > > > 1. Currently, In ReorderBufferCommit, it is always expected that > > whenever we get REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM, we must > >

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

2020-01-09 Thread Dilip Kumar
On Sat, Jan 4, 2020 at 4:07 PM Amit Kapila wrote: > > On Mon, Dec 30, 2019 at 3:11 PM Dilip Kumar wrote: > > > > On Thu, Dec 12, 2019 at 9:44 AM Dilip Kumar wrote: > > > > 0002-Issue-individual-invalidations-with-wal_level-log > > > >

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

2020-01-08 Thread Dilip Kumar
On Thu, Jan 9, 2020 at 12:09 PM Amit Kapila wrote: > > On Thu, Jan 9, 2020 at 10:30 AM Dilip Kumar wrote: > > > > On Thu, Jan 9, 2020 at 9:35 AM Amit Kapila wrote: > > > > > > On Wed, Jan 8, 2020 at 1:12 PM Dilip Kumar wrote: > > > > > > > > I have observed one more design issue. > > > > > > >

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

2020-01-08 Thread Amit Kapila
On Thu, Jan 9, 2020 at 10:30 AM Dilip Kumar wrote: > > On Thu, Jan 9, 2020 at 9:35 AM Amit Kapila wrote: > > > > On Wed, Jan 8, 2020 at 1:12 PM Dilip Kumar wrote: > > > > > > I have observed one more design issue. > > > > > > > Good observation. > > > > > The problem is that when we > > > get a

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

2020-01-08 Thread Dilip Kumar
On Thu, Jan 9, 2020 at 9:35 AM Amit Kapila wrote: > > On Wed, Jan 8, 2020 at 1:12 PM Dilip Kumar wrote: > > > > I have observed one more design issue. > > > > Good observation. > > > The problem is that when we > > get a toasted chunks we remember the changes in the memory(hash table) > > but do

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

2020-01-08 Thread Amit Kapila
On Wed, Jan 8, 2020 at 1:12 PM Dilip Kumar wrote: > > I have observed one more design issue. > Good observation. > The problem is that when we > get a toasted chunks we remember the changes in the memory(hash table) > but don't stream until we get the actual change on the main table. > Now, the

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

2020-01-07 Thread Dilip Kumar
On Mon, Jan 6, 2020 at 4:44 PM Dilip Kumar wrote: > > On Mon, Jan 6, 2020 at 4:36 PM Amit Kapila wrote: > > > > On Mon, Jan 6, 2020 at 3:56 PM Dilip Kumar wrote: > > > > > > On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila > > > wrote: > > > > > > > > 3. > > > > +static void > > > > +ReorderBufferSt

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

2020-01-06 Thread Dilip Kumar
On Mon, Jan 6, 2020 at 4:36 PM Amit Kapila wrote: > > On Mon, Jan 6, 2020 at 3:56 PM Dilip Kumar wrote: > > > > On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila wrote: > > > > > > 3. > > > +static void > > > +ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) > > > { > > > .. > > > + /*

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

2020-01-06 Thread Amit Kapila
On Mon, Jan 6, 2020 at 3:56 PM Dilip Kumar wrote: > > On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila wrote: > > > > 3. > > +static void > > +ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBufferTXN *txn) > > { > > .. > > + /* > > + * If this is a subxact, we need to stream the top-level transaction

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

2020-01-06 Thread Dilip Kumar
On Mon, Jan 6, 2020 at 2:11 PM Amit Kapila wrote: > > On Mon, Jan 6, 2020 at 9:21 AM Dilip Kumar wrote: > > > > On Sat, Jan 4, 2020 at 4:07 PM Amit Kapila wrote: > > > > > > > > > It is better to merge it with the main patch for > > > "Implement-streaming-mode-in-ReorderBuffer", otherwise, it is

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

2020-01-06 Thread Amit Kapila
On Mon, Jan 6, 2020 at 9:21 AM Dilip Kumar wrote: > > On Sat, Jan 4, 2020 at 4:07 PM Amit Kapila wrote: > > > > > > It is better to merge it with the main patch for > > "Implement-streaming-mode-in-ReorderBuffer", otherwise, it is a bit > > difficult to review. > Actually, we can merge 0008, 0009

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

2020-01-05 Thread Dilip Kumar
On Sat, Jan 4, 2020 at 4:07 PM Amit Kapila wrote: > > On Mon, Dec 30, 2019 at 3:11 PM Dilip Kumar wrote: > > > > On Thu, Dec 12, 2019 at 9:44 AM Dilip Kumar wrote: > > > > > Yesterday, Tomas has posted the latest version of the patch set which > > contain the fix for schema send part. Meanwhile

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

2020-01-04 Thread Amit Kapila
On Mon, Dec 30, 2019 at 3:11 PM Dilip Kumar wrote: > > On Thu, Dec 12, 2019 at 9:44 AM Dilip Kumar wrote: > > > Yesterday, Tomas has posted the latest version of the patch set which > contain the fix for schema send part. Meanwhile, I was working on few > review comments/bugfixes and refactoring

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

2020-01-03 Thread Dilip Kumar
On Sat, Jan 4, 2020 at 10:00 AM Amit Kapila wrote: > > On Sun, Dec 29, 2019 at 1:34 PM Dilip Kumar wrote: > > On Sat, Dec 28, 2019 at 9:33 PM Tomas Vondra > > wrote: > > +static void > > +set_schema_sent_in_streamed_txn(RelationSyncEntry *entry, TransactionId > > xid) > > +{ > > + MemoryContext

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

2020-01-03 Thread Amit Kapila
On Sun, Dec 29, 2019 at 1:34 PM Dilip Kumar wrote: > On Sat, Dec 28, 2019 at 9:33 PM Tomas Vondra > wrote: > > > > > > Yeah, the "is_schema_sent" flag in ReorderBufferTXN does not work - it > > needs to be in the RelationSyncEntry. In fact, I already have code for > > that in my private repositor

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

2020-01-03 Thread Amit Kapila
On Tue, Dec 24, 2019 at 10:58 AM Robert Haas wrote: > > On Thu, Dec 12, 2019 at 3:41 AM Amit Kapila wrote: > > > I think the way invalidations work for logical replication is that > > normally, we always start a new transaction before decoding each > > commit which allows us to accept the invalid

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

2020-01-01 Thread Dilip Kumar
On Mon, Dec 30, 2019 at 3:43 PM Amit Kapila wrote: > > On Sun, Dec 29, 2019 at 1:34 PM Dilip Kumar wrote: > > > > I have observed some more issues > > > > 1. Currently, In ReorderBufferCommit, it is always expected that > > whenever we get REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM, we must > >

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

2019-12-30 Thread Amit Kapila
On Thu, Dec 26, 2019 at 12:36 PM Masahiko Sawada wrote: > > On Tue, 24 Dec 2019 at 17:21, Amit Kapila wrote: > > > > > > > > Thank you for explanation. The plan makes sense. But I think in the > > > current design it's a problem that logical replication worker doesn't > > > receive changes (and d

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

2019-12-30 Thread Amit Kapila
On Sun, Dec 29, 2019 at 1:34 PM Dilip Kumar wrote: > > I have observed some more issues > > 1. Currently, In ReorderBufferCommit, it is always expected that > whenever we get REORDER_BUFFER_CHANGE_INTERNAL_SPEC_CONFIRM, we must > have already got REORDER_BUFFER_CHANGE_INTERNAL_SPEC_INSERT and in >

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

2019-12-29 Thread Dilip Kumar
On Sat, Dec 28, 2019 at 9:33 PM Tomas Vondra wrote: > > On Tue, Dec 10, 2019 at 10:23:19AM +0530, Dilip Kumar wrote: > >On Tue, Dec 10, 2019 at 9:52 AM Amit Kapila wrote: > >> > >> On Mon, Dec 2, 2019 at 2:02 PM Dilip Kumar wrote: > >> > > >> > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier >

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

2019-12-25 Thread Masahiko Sawada
On Tue, 24 Dec 2019 at 17:21, Amit Kapila wrote: > > On Tue, Dec 24, 2019 at 11:17 AM Masahiko Sawada > wrote: > > > > On Fri, 20 Dec 2019 at 22:30, Amit Kapila wrote: > > > > > > > > > The main aim of this feature is to reduce apply lag. Because if we > > > send all the changes together it can

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

2019-12-24 Thread Amit Kapila
On Tue, Dec 24, 2019 at 11:17 AM Masahiko Sawada wrote: > > On Fri, 20 Dec 2019 at 22:30, Amit Kapila wrote: > > > > > > The main aim of this feature is to reduce apply lag. Because if we > > send all the changes together it can delay there apply because of > > network delay, whereas if most of

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

2019-12-23 Thread Masahiko Sawada
On Fri, 20 Dec 2019 at 22:30, Amit Kapila wrote: > > On Fri, Dec 20, 2019 at 11:47 AM Masahiko Sawada > wrote: > > > > On Mon, 2 Dec 2019 at 17:32, Dilip Kumar wrote: > > > > > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier > > > wrote: > > > > > > > > On Fri, Nov 22, 2019 at 01:18:11PM +053

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

2019-12-23 Thread Robert Haas
On Thu, Dec 12, 2019 at 3:41 AM Amit Kapila wrote: > I don't think we have evaluated it yet, but we should do it. The > point to note is that it is only for the case when wal_level is > 'logical' (see IsSubTransactionAssignmentPending) in which case we > already log more WAL, so this might not im

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

2019-12-23 Thread Amit Kapila
On Sun, Dec 22, 2019 at 5:04 PM vignesh C wrote: > > Few comments: > assert variable should be within #ifdef USE_ASSERT_CHECKING in patch > v2-0008-Add-support-for-streaming-to-built-in-replication.patch: > + int64 subidx; > + boolfound = false; >

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

2019-12-22 Thread vignesh C
On Mon, Dec 2, 2019 at 2:02 PM Dilip Kumar wrote: > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > I have rebased the patch on the latest head and also fix the issue of > > > "concurrent abort handling of the (sub

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

2019-12-20 Thread Amit Kapila
On Fri, Dec 20, 2019 at 2:00 PM Kyotaro Horiguchi wrote: > > Hello. > > At Fri, 13 Dec 2019 14:46:20 +0530, Amit Kapila > wrote in > > On Wed, Dec 11, 2019 at 11:46 PM Robert Haas wrote: > > > > > > On Mon, Dec 2, 2019 at 3:32 AM Dilip Kumar wrote: > > > > I have rebased the patch set on the l

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

2019-12-20 Thread Amit Kapila
On Fri, Dec 20, 2019 at 11:47 AM Masahiko Sawada wrote: > > On Mon, 2 Dec 2019 at 17:32, Dilip Kumar wrote: > > > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > > I have rebased the patch on the latest head a

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

2019-12-20 Thread Kyotaro Horiguchi
Hello. At Fri, 13 Dec 2019 14:46:20 +0530, Amit Kapila wrote in > On Wed, Dec 11, 2019 at 11:46 PM Robert Haas wrote: > > > > On Mon, Dec 2, 2019 at 3:32 AM Dilip Kumar wrote: > > > I have rebased the patch set on the latest head. > > > > 0001 looks like a clever approach, but are you sure it

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

2019-12-19 Thread Masahiko Sawada
On Mon, 2 Dec 2019 at 17:32, Dilip Kumar wrote: > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > I have rebased the patch on the latest head and also fix the issue of > > > "concurrent abort handling of the (sub)t

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

2019-12-13 Thread Amit Kapila
On Thu, Dec 12, 2019 at 9:45 AM Dilip Kumar wrote: > > On Wed, Dec 11, 2019 at 5:22 PM Amit Kapila wrote: > > > > On Mon, Dec 9, 2019 at 1:27 PM Dilip Kumar wrote: > > > > > > I have review the patch set and here are few comments/questions > > > > > > 1. > > > +static void > > > +pg_decode_strea

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

2019-12-13 Thread Amit Kapila
On Wed, Dec 11, 2019 at 11:46 PM Robert Haas wrote: > > On Mon, Dec 2, 2019 at 3:32 AM Dilip Kumar wrote: > > I have rebased the patch set on the latest head. > > 0001 looks like a clever approach, but are you sure it doesn't hurt > performance when many small XLOG records are being inserted? I t

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

2019-12-12 Thread Amit Kapila
On Wed, Dec 11, 2019 at 11:46 PM Robert Haas wrote: > > On Mon, Dec 2, 2019 at 3:32 AM Dilip Kumar wrote: > > I have rebased the patch set on the latest head. > > 0001 looks like a clever approach, but are you sure it doesn't hurt > performance when many small XLOG records are being inserted? I t

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

2019-12-11 Thread Dilip Kumar
On Wed, Dec 11, 2019 at 5:22 PM Amit Kapila wrote: > > On Mon, Dec 9, 2019 at 1:27 PM Dilip Kumar wrote: > > > > I have review the patch set and here are few comments/questions > > > > 1. > > +static void > > +pg_decode_stream_change(LogicalDecodingContext *ctx, > > + ReorderBufferTXN *txn, > > +

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

2019-12-11 Thread Robert Haas
On Mon, Dec 2, 2019 at 3:32 AM Dilip Kumar wrote: > I have rebased the patch set on the latest head. 0001 looks like a clever approach, but are you sure it doesn't hurt performance when many small XLOG records are being inserted? I think XLogRecordAssemble() can get pretty hot in some workloads.

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

2019-12-11 Thread Amit Kapila
On Mon, Dec 9, 2019 at 1:27 PM Dilip Kumar wrote: > > I have review the patch set and here are few comments/questions > > 1. > +static void > +pg_decode_stream_change(LogicalDecodingContext *ctx, > + ReorderBufferTXN *txn, > + Relation relation, > + ReorderBufferChange *change) > +{ > + OutputPlug

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

2019-12-09 Thread Dilip Kumar
On Tue, Dec 10, 2019 at 9:52 AM Amit Kapila wrote: > > On Mon, Dec 2, 2019 at 2:02 PM Dilip Kumar wrote: > > > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > > I have rebased the patch on the latest head and

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

2019-12-09 Thread Amit Kapila
On Mon, Dec 2, 2019 at 2:02 PM Dilip Kumar wrote: > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > I have rebased the patch on the latest head and also fix the issue of > > > "concurrent abort handling of the (sub

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

2019-12-08 Thread Dilip Kumar
On Mon, Dec 2, 2019 at 2:01 PM Dilip Kumar wrote: > > On Sun, Dec 1, 2019 at 7:58 AM Michael Paquier wrote: > > > > On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > > > I have rebased the patch on the latest head and also fix the issue of > > > "concurrent abort handling of the (sub

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

2019-11-30 Thread Michael Paquier
On Fri, Nov 22, 2019 at 01:18:11PM +0530, Dilip Kumar wrote: > I have rebased the patch on the latest head and also fix the issue of > "concurrent abort handling of the (sub)transaction." and attached as > (v1-0013-Extend-handling-of-concurrent-aborts-for-streamin) along with > the complete patch s

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

2019-11-21 Thread Amit Kapila
On Tue, Nov 19, 2019 at 5:25 PM Amit Kapila wrote: > > On Sat, Nov 16, 2019 at 6:44 PM Amit Kapila wrote: > > > > On Thu, Nov 7, 2019 at 5:13 PM Amit Kapila wrote: > > > > > > Some notes before commit: > > > -- > > > 1. > > > Commit message need to be changed

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

2019-11-20 Thread Dilip Kumar
On Wed, Nov 20, 2019 at 8:22 PM Dilip Kumar wrote: > > On Wed, Nov 20, 2019 at 11:15 AM Dilip Kumar wrote: > > > > On Tue, Nov 19, 2019 at 5:23 PM Amit Kapila wrote: > > > > > > On Mon, Nov 18, 2019 at 5:02 PM Dilip Kumar wrote: > > > > > > > > On Fri, Nov 15, 2019 at 4:19 PM Amit Kapila > >

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

2019-11-19 Thread Dilip Kumar
On Tue, Nov 19, 2019 at 5:23 PM Amit Kapila wrote: > > On Mon, Nov 18, 2019 at 5:02 PM Dilip Kumar wrote: > > > > On Fri, Nov 15, 2019 at 4:19 PM Amit Kapila wrote: > > > > > > On Fri, Nov 15, 2019 at 4:01 PM Dilip Kumar wrote: > > > > > > > > On Fri, Nov 15, 2019 at 3:50 PM Amit Kapila > > >

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

2019-11-19 Thread Amit Kapila
On Sat, Nov 16, 2019 at 6:44 PM Amit Kapila wrote: > > On Thu, Nov 7, 2019 at 5:13 PM Amit Kapila wrote: > > > > Some notes before commit: > > -- > > 1. > > Commit message need to be changed for the first patch > > --

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

2019-11-19 Thread Amit Kapila
On Mon, Nov 18, 2019 at 5:02 PM Dilip Kumar wrote: > > On Fri, Nov 15, 2019 at 4:19 PM Amit Kapila wrote: > > > > On Fri, Nov 15, 2019 at 4:01 PM Dilip Kumar wrote: > > > > > > On Fri, Nov 15, 2019 at 3:50 PM Amit Kapila > > > wrote: > > > > > > > > > > > > Few other comments on this patch: >

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

2019-11-18 Thread Dilip Kumar
On Fri, Nov 15, 2019 at 4:19 PM Amit Kapila wrote: > > On Fri, Nov 15, 2019 at 4:01 PM Dilip Kumar wrote: > > > > On Fri, Nov 15, 2019 at 3:50 PM Amit Kapila wrote: > > > > > > > > > Few other comments on this patch: > > > 1. > > > + case REORDER_BUFFER_CHANGE_INVALIDATION: > > > + > > > + /* >

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

2019-11-16 Thread Amit Kapila
On Thu, Nov 7, 2019 at 5:13 PM Amit Kapila wrote: > > Some notes before commit: > -- > 1. > Commit message need to be changed for the first patch > - > A. > > The memory limit is defined by

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

2019-11-15 Thread Amit Kapila
On Fri, Nov 15, 2019 at 4:01 PM Dilip Kumar wrote: > > On Fri, Nov 15, 2019 at 3:50 PM Amit Kapila wrote: > > > > > > Few other comments on this patch: > > 1. > > + case REORDER_BUFFER_CHANGE_INVALIDATION: > > + > > + /* > > + * Execute the invalidation message locally. > > + * > > + * XXX Do we

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

2019-11-15 Thread Dilip Kumar
On Fri, Nov 15, 2019 at 3:50 PM Amit Kapila wrote: > > On Thu, Nov 14, 2019 at 3:40 PM Dilip Kumar wrote: > > > > > > Apart from this, I have another question in > > 0003-Issue-individual-invalidations-with-wal_level-logical.patch > > > > @@ -543,6 +588,18 @@ RegisterSnapshotInvalidation(Oid dbId

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

2019-11-15 Thread Amit Kapila
On Thu, Nov 14, 2019 at 3:40 PM Dilip Kumar wrote: > > > Apart from this, I have another question in > 0003-Issue-individual-invalidations-with-wal_level-logical.patch > > @@ -543,6 +588,18 @@ RegisterSnapshotInvalidation(Oid dbId, Oid relId) > { > AddSnapshotInvalidationMessage(&transInvalInfo

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

2019-11-14 Thread Dilip Kumar
On Thu, Nov 14, 2019 at 12:10 PM Amit Kapila wrote: > > On Thu, Nov 14, 2019 at 9:37 AM Dilip Kumar wrote: > > > > On Wed, Nov 13, 2019 at 5:55 PM Amit Kapila wrote: > > > > > > On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > > > > > > > > > As mentioned by me a few days back that the fir

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

2019-11-13 Thread Amit Kapila
On Thu, Nov 14, 2019 at 9:37 AM Dilip Kumar wrote: > > On Wed, Nov 13, 2019 at 5:55 PM Amit Kapila wrote: > > > > On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > > > > > > As mentioned by me a few days back that the first patch in this series > > is ready to go [1] (I am hoping Tomas will

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

2019-11-13 Thread Dilip Kumar
On Wed, Nov 13, 2019 at 5:55 PM Amit Kapila wrote: > > On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > > > As mentioned by me a few days back that the first patch in this series > is ready to go [1] (I am hoping Tomas will pick it up), so I have > started the review of other patches > > Rev

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

2019-11-13 Thread Amit Kapila
On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > As mentioned by me a few days back that the first patch in this series is ready to go [1] (I am hoping Tomas will pick it up), so I have started the review of other patches Review/Questions on 0002-Immediately-WAL-log-assignments.patch

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

2019-11-12 Thread Kuntal Ghosh
On Tue, Nov 12, 2019 at 4:12 PM Alexey Kondratov wrote: > > On 04.11.2019 13:05, Kuntal Ghosh wrote: > > On Mon, Nov 4, 2019 at 3:32 PM Dilip Kumar wrote: > >> So your result shows that with "streaming on", performance is > >> degrading? By any chance did you try to see where is the bottleneck?

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

2019-11-12 Thread Alexey Kondratov
On 04.11.2019 13:05, Kuntal Ghosh wrote: On Mon, Nov 4, 2019 at 3:32 PM Dilip Kumar wrote: So your result shows that with "streaming on", performance is degrading? By any chance did you try to see where is the bottleneck? Right. But, as we increase the logical_decoding_work_mem, the performa

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

2019-11-07 Thread Amit Kapila
On Thu, Nov 7, 2019 at 3:50 PM Dilip Kumar wrote: > > On Thu, Nov 7, 2019 at 3:19 PM Amit Kapila wrote: > > > What do you think? > I have reviewed your changes and looks fine to me. > Okay, thanks. I am also happy with the two patches I have posted in my last email [1]. Tomas, would you like t

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

2019-11-07 Thread Dilip Kumar
On Thu, Nov 7, 2019 at 3:19 PM Amit Kapila wrote: > > On Wed, Nov 6, 2019 at 11:33 AM vignesh C wrote: > > > > I have made one change to the configuration file in > > contrib/test_decoding directory, with that the coverage seems to be > > fine. I have seen that the coverage is almost like the cod

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

2019-11-07 Thread Amit Kapila
On Wed, Nov 6, 2019 at 11:33 AM vignesh C wrote: > > I have made one change to the configuration file in > contrib/test_decoding directory, with that the coverage seems to be > fine. I have seen that the coverage is almost like the code before > applying the patch. I have attached the test change

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

2019-11-06 Thread vignesh C
On Mon, Nov 4, 2019 at 5:22 PM Amit Kapila wrote: > > On Wed, Oct 30, 2019 at 9:38 AM vignesh C wrote: > > > > On Tue, Oct 22, 2019 at 10:52 PM Tomas Vondra > > wrote: > > > > > > I think the patch should do the simplest thing possible, i.e. what it > > > does today. Otherwise we'll never get it

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

2019-11-04 Thread Dilip Kumar
On Mon, Nov 4, 2019 at 5:22 PM Amit Kapila wrote: > > On Wed, Oct 30, 2019 at 9:38 AM vignesh C wrote: > > > > On Tue, Oct 22, 2019 at 10:52 PM Tomas Vondra > > wrote: > > > > > > I think the patch should do the simplest thing possible, i.e. what it > > > does today. Otherwise we'll never get it

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

2019-11-04 Thread Amit Kapila
On Wed, Oct 30, 2019 at 9:38 AM vignesh C wrote: > > On Tue, Oct 22, 2019 at 10:52 PM Tomas Vondra > wrote: > > > > I think the patch should do the simplest thing possible, i.e. what it > > does today. Otherwise we'll never get it committed. > > > I found a couple of crashes while reviewing and t

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

2019-11-04 Thread vignesh C
On Thu, Oct 24, 2019 at 7:07 PM Amit Kapila wrote: > > On Tue, Oct 22, 2019 at 10:30 AM Dilip Kumar wrote: > > > > I have merged bugs_and_review_comments_fix.patch changes to 0001 and 0002. > > > > I was wondering whether we have checked the code coverage after this > patch? Previously, the exis

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

2019-11-04 Thread Kuntal Ghosh
On Mon, Nov 4, 2019 at 3:32 PM Dilip Kumar wrote: > > So your result shows that with "streaming on", performance is > degrading? By any chance did you try to see where is the bottleneck? > Right. But, as we increase the logical_decoding_work_mem, the performance improves. I've not analyzed the bo

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

2019-11-04 Thread Dilip Kumar
On Mon, Nov 4, 2019 at 2:43 PM Kuntal Ghosh wrote: > > Hello hackers, > > I've done some performance testing of this feature. Following is my > test case (taken from an earlier thread): > > postgres=# CREATE TABLE large_test (num1 bigint, num2 double > precision, num3 double precision); > postgres

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

2019-11-04 Thread Kuntal Ghosh
Hello hackers, I've done some performance testing of this feature. Following is my test case (taken from an earlier thread): postgres=# CREATE TABLE large_test (num1 bigint, num2 double precision, num3 double precision); postgres=# \timing on postgres=# EXPLAIN (ANALYZE, BUFFERS) INSERT INTO larg

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

2019-10-30 Thread Dilip Kumar
On Wed, Oct 30, 2019 at 9:38 AM vignesh C wrote: > I have noticed one more problem in the logic of setting the logical decoding work mem from the create subscription command. Suppose in subscription command we don't give the work mem then it sends the garbage value to the walsender and the walsen

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

2019-10-29 Thread vignesh C
On Tue, Oct 22, 2019 at 10:52 PM Tomas Vondra wrote: > > I think the patch should do the simplest thing possible, i.e. what it > does today. Otherwise we'll never get it committed. > I found a couple of crashes while reviewing and testing flushing of open transaction data: Issue 1: #0 0x7f22c

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

2019-10-24 Thread Amit Kapila
On Tue, Oct 22, 2019 at 10:30 AM Dilip Kumar wrote: > > I have merged bugs_and_review_comments_fix.patch changes to 0001 and 0002. > I was wondering whether we have checked the code coverage after this patch? Previously, the existing tests seem to be covering most parts of the function ReorderBu

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

2019-10-23 Thread Amit Kapila
On Wed, Oct 23, 2019 at 12:32 AM Alexey Kondratov wrote: > > On 22.10.2019 20:22, Tomas Vondra wrote: > > > > I think the patch should do the simplest thing possible, i.e. what it > > does today. Otherwise we'll never get it committed. > > > > I have to agree with Tomas, that keeping things as sim

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

2019-10-23 Thread Amit Kapila
On Tue, Oct 22, 2019 at 10:42 PM Tomas Vondra wrote: > > On Tue, Oct 22, 2019 at 10:30:16AM +0530, Dilip Kumar wrote: > > > >I have moved it out as a separate patch (0003) so that if we need that > >we need this for the streaming transaction then we can keep this. > >> > > I'm OK with moving it to

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

2019-10-22 Thread Alexey Kondratov
On 22.10.2019 20:22, Tomas Vondra wrote: On Tue, Oct 22, 2019 at 11:01:48AM +0530, Dilip Kumar wrote: On Tue, Oct 22, 2019 at 10:46 AM Amit Kapila wrote:   In general, yours and Alexy's test results show that there is merit by having workers applying such transactions.   OTOH, as noted above

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

2019-10-22 Thread Tomas Vondra
On Tue, Oct 22, 2019 at 11:01:48AM +0530, Dilip Kumar wrote: On Tue, Oct 22, 2019 at 10:46 AM Amit Kapila wrote: On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > I have attempted to test the performance of (Stream + Spill) vs > (Stream + BGW pool) and I can see the similar gain what Alex

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

2019-10-22 Thread Tomas Vondra
On Tue, Oct 22, 2019 at 10:30:16AM +0530, Dilip Kumar wrote: On Fri, Oct 18, 2019 at 5:32 PM Amit Kapila wrote: On Mon, Oct 14, 2019 at 3:09 PM Dilip Kumar wrote: > > On Thu, Oct 3, 2019 at 4:03 AM Tomas Vondra > wrote: > > > > > > Sure, I wasn't really proposing to adding all stats from tha

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

2019-10-21 Thread Dilip Kumar
On Tue, Oct 22, 2019 at 10:46 AM Amit Kapila wrote: > > On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > > > I have attempted to test the performance of (Stream + Spill) vs > > (Stream + BGW pool) and I can see the similar gain what Alexey had > > shown[1]. > > > > In addition to this, I hav

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

2019-10-21 Thread Amit Kapila
On Thu, Oct 3, 2019 at 1:18 PM Dilip Kumar wrote: > > I have attempted to test the performance of (Stream + Spill) vs > (Stream + BGW pool) and I can see the similar gain what Alexey had > shown[1]. > > In addition to this, I have rebased the latest patchset [2] without > the two-phase logical dec

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

2019-10-21 Thread Dilip Kumar
On Fri, Oct 18, 2019 at 5:32 PM Amit Kapila wrote: > > On Mon, Oct 14, 2019 at 3:09 PM Dilip Kumar wrote: > > > > On Thu, Oct 3, 2019 at 4:03 AM Tomas Vondra > > wrote: > > > > > > > > > Sure, I wasn't really proposing to adding all stats from that patch, > > > including those related to streami

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

2019-10-21 Thread Dilip Kumar
On Mon, Oct 21, 2019 at 2:50 PM Amit Kapila wrote: > > On Mon, Oct 21, 2019 at 10:48 AM Dilip Kumar wrote: > > > > On Fri, Oct 18, 2019 at 5:32 PM Amit Kapila wrote: > > > > > 3. > > > @@ -2479,7 +2480,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, > > > ReorderBufferTXN *txn) > > > > > > /

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

2019-10-21 Thread Amit Kapila
On Mon, Oct 21, 2019 at 10:48 AM Dilip Kumar wrote: > > On Fri, Oct 18, 2019 at 5:32 PM Amit Kapila wrote: > > > 3. > > @@ -2479,7 +2480,7 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, > > ReorderBufferTXN *txn) > > > > /* update the statistics */ > > rb->spillCount += 1; > > - rb->spillTxn

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

2019-10-20 Thread Dilip Kumar
On Fri, Oct 18, 2019 at 5:32 PM Amit Kapila wrote: I have replied to some of your questions inline. I will work on the remaining comments and post the patch for the same. > > > > > > Sure, I wasn't really proposing to adding all stats from that patch, > > > including those related to streaming.

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

2019-10-18 Thread Amit Kapila
On Mon, Oct 14, 2019 at 3:09 PM Dilip Kumar wrote: > > On Thu, Oct 3, 2019 at 4:03 AM Tomas Vondra > wrote: > > > > > > Sure, I wasn't really proposing to adding all stats from that patch, > > including those related to streaming. We need to extract just those > > related to spilling. And yes, i

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

2019-10-14 Thread Dilip Kumar
On Thu, Oct 3, 2019 at 4:03 AM Tomas Vondra wrote: > > On Wed, Oct 02, 2019 at 04:27:30AM +0530, Amit Kapila wrote: > >On Tue, Oct 1, 2019 at 7:21 PM Tomas Vondra > >wrote: > > > >> On Tue, Oct 01, 2019 at 06:55:52PM +0530, Amit Kapila wrote: > >> > > >> >On further testing, I found that the patc

<    1   2   3   4   5   >