Re: [HACKERS] logical decoding of two-phase transactions

2017-11-30 Thread Nikhil Sontakke
Hi, >> So perhaps better approach would be to not return >> HEAPTUPLE_DEAD if the transaction id is newer than the OldestXmin (same >> logic we use for deleted tuples of committed transactions) in the >> HeapTupleSatisfiesVacuum() even for aborted transactions. I also briefly >> checked HOT

Re: [HACKERS] logical decoding of two-phase transactions

2017-12-05 Thread Nikhil Sontakke
unctionality) that might come in handy, is to have a way for DDL to be actually carried out on the subscriber. We will need something like pglogical.replicate_ddl_command to be added to the core for this to work. We can add this functionality as a follow-on separate patch after discussin

Re: [HACKERS] logical decoding of two-phase transactions

2017-12-19 Thread Nikhil Sontakke
ith a separate >> discussion thread. > > Are you working on that as well? Sure, I was planning to work on that after getting the documentation for this patch out of the way. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2017-12-04 Thread Nikhil Sontakke
ll that unwanted snapshot push/pop code, which is nice. Regards, Nikhils On 30 November 2017 at 16:08, Nikhil Sontakke <nikh...@2ndquadrant.com> wrote: > Hi, > > >>> So perhaps better approach would be to not return >>> HEAPTUPLE_DEAD if the transaction id is

Re: [HACKERS] logical decoding of two-phase transactions

2017-12-12 Thread Nikhil Sontakke
drant.com> wrote: > On 12/7/17 08:31, Peter Eisentraut wrote: >> On 12/4/17 10:15, Nikhil Sontakke wrote: >>> PFA, latest patch for this functionality. >> >> This probably needs documentation updates for the logical decoding chapter. > > You need the attached

Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding

2018-06-14 Thread Nikhil Sontakke
Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services gid_length.patch Description: Binary data

Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding

2018-06-17 Thread Nikhil Sontakke
code present in the core as of now. I am going to submit it in the upcoming commitfest. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions

2018-01-28 Thread Nikhil Sontakke
till ok to decode, read the catalog and unlock. Abort/Commit transaction processing could take this in EXCLUSIVE mode. As mentioned above, the plugin API which takes this lock will be smart enough to be a NOOP if the transaction is not running (i.e we are not doing 2PC decoding or streaming) or when

Re: [HACKERS] logical decoding of two-phase transactions

2018-02-12 Thread Nikhil Sontakke
e logical pieces and re-submit. > > On 2018-02-06 17:50:40 +0530, Nikhil Sontakke wrote: >> @@ -46,6 +48,9 @@ typedef struct >> boolskip_empty_xacts; >> boolxact_wrote_changes; >> boolonly_loca

Re: [HACKERS] logical decoding of two-phase transactions

2018-02-09 Thread Nikhil Sontakke
ansaction is my query? I don't see the need for doing that for skipped transactions.. Will continue to look at this and will add this scenario to the test cases. Further comments/feedback appreciated. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Logical Decoding and HeapTupleSatisfiesVacuum assumptions

2017-12-26 Thread Nikhil Sontakke
rt enabled and things run fine. Also, since it only sets the flag for system/user catalog tables and that too ONLY in the logical decoding environment, it does not cause any performance issues in normal circumstances. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/

Re: [HACKERS] logical decoding of two-phase transactions

2018-08-02 Thread Nikhil Sontakke
k, added unlikely() checks in the heap_* scan APIs. Revised patchset attached. Regards, Nikhils > Greetings, > > Andres Freund -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services 0001-Cleaning-up-of-flags-in-

Re: [HACKERS] logical decoding of two-phase transactions

2018-08-01 Thread Nikhil Sontakke
2PC at prepare time and another are > "commit prepared" time. > The test_decoding pg_decode_filter_prepare() API implements a simple filter strategy now. If the GID contains a substring "nodecode", then it filters out decoding of such a 2PC at prepare time. Have added s

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-27 Thread Nikhil Sontakke
k? > tqual.c does seem to mention this for a non-MVCC snapshot, so might as well do it this ways. The caching of fetched XID should not make these checks too expensive anyways. > > I think it'd also be good to add assertions to codepaths not going > through systable_* asserting that > !Transactio

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-26 Thread Nikhil Sontakke
ently decoded. Andres generally doesn't like this approach :-), but there are no timing/interlocking issues now, and the sleep just helps us do a concurrent rollback, so it might be ok now, all things considered. Anyways, it's an additional patch for now. Comments, feedback appreciated. Regards, Nikhils -- Ni

Re: [HACKERS] logical decoding of two-phase transactions

2018-08-07 Thread Nikhil Sontakke
ransactionIdIsInProgress(CheckXidAlive) && > + !TransactionIdDidCommit(CheckXidAlive)) > + ereport(ERROR, > + (errcode(ERRCODE_TRANSACTION_ROLLBACK), > +errmsg("transaction aborted during system > catalog scan"))); > > Probably centralize checks in one function? As well as 'We don't expect > direct calls to heap_fetch...' ones. > > > P.S. Looks like you have torn the thread chain: In-Reply-To header of > mail [1] is missing. Please don't do that. > That wasn't me. I was also annoyed and surprised to see a new email thread separate from the earlier containing 100 or so messages. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-20 Thread Nikhil Sontakke
Hi Andres, > So what if we, at the begin / end of cache miss handling, re-check if > the to-be-decoded transaction is still in-progress (or has > committed). And we throw an error if that happened. That error is then > caught in reorderbuffer, the in-progress-xact aborted callback is > called,

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-23 Thread Nikhil Sontakke
Hi Andres, >> We can find out if the snapshot is a logical decoding one by virtue of >> its "satisfies" function pointing to HeapTupleSatisfiesHistoricMVCC. > > I think we even can just do something like a global > TransactionId check_if_transaction_is_alive = InvalidTransactionId; > and just

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-23 Thread Nikhil Sontakke
need to make the "being-currently-decoded-XID" visible to these systable_* functions and then this scheme will work. Regards, Nikhils > Greetings, > > Andres Freund -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-07-19 Thread Nikhil Sontakke
mpletely-made changes by the last CID aren't seen if an > abort happens. I think there is a good chance that a full solution > involves more than one of these things, and maybe some other things I > haven't thought about. These are ideas, not a plan. > I will think more on the above lines and see if we can get something workable.. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services

Re: Logical Decoding and HeapTupleSatisfiesVacuum assumptions

2018-01-23 Thread Nikhil Sontakke
I will cook up something along the above lines unless there are any objections to this approach. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-04-10 Thread Nikhil Sontakke
>> Anyways, will now wait for the next commitfest/opportunity to try to >> get this in. > > It looks like this patch should be in the Needs Review state so I have > done that and moved it to the next CF. > Thanks David, Regards, Nikhils -- Nikhil Sontakke

Re: [HACKERS] logical decoding of two-phase transactions

2018-04-05 Thread Nikhil Sontakke
hat's happening. We join the group on the first call and > then we only tweak the decodeLocked flag. > True. > > 7) I propose minor changes to a couple of comments. > Ok, I am looking at your provided patch and incorporating relevant changes from it. WIll submit a patch set soon. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-04-09 Thread Nikhil Sontakke
ap3.anarazel.de Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-03-30 Thread Nikhil Sontakke
Hi Petr, Andres and Tomas >>> Thanks. I think the README is a good start, but I think we also need to >>> improve the comments, which is usually more detailed than the README. >>> For example, it's not quite acceptable that LogicalLockTransaction and >>> LogicalUnlockTransaction have about no

Re: [HACKERS] logical decoding of two-phase transactions

2018-04-02 Thread Nikhil Sontakke
> > Quick thought: Should be simple to release lock when interacting with network. I don’t think this will be that simple. The network calls will typically happen from inside the plugins and we don’t want to make plugin authors responsible for that. > Could also have abort signal lockers.

Re: [HACKERS] logical decoding of two-phase transactions

2018-04-03 Thread Nikhil Sontakke
r wasteful to allocate > 200B when the rest of the struct has only ~100B. This is particularly > problematic considering ReorderBufferTXN is not spilled to disk when > reaching the memory limit. It needs to be allocated ad-hoc only when > actually needed. > OK, will look at allocat

Re: Feature Request - DDL deployment with logical replication

2018-03-31 Thread Nikhil Sontakke
rms of schema changes. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL/Postgres-XL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-03-01 Thread Nikhil Sontakke
whole patchset is > visibly versioned and sorts in the correct order. > I did try to use *_Number.patch to convey the sequence, but admittedly it's pretty lame. I will re-submit with "git format-patch" soon. Regards, Nikhils -- Nikhil Sontakke http://www.2ndQuadra

Re: [HACKERS] logical decoding of two-phase transactions

2018-11-29 Thread Nikhil Sontakke
omas Vondra http://www.2ndQuadrant.com > > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services > > > -- > Nikhil Sontakke http://www.2ndQuadrant.com/ > PostgreSQL Development, 24x7 Support, Training & Services

Re: [HACKERS] logical decoding of two-phase transactions

2018-11-29 Thread Nikhil Sontakke
> -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Nikhil Sontakke http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services 0001-Cleanin

Re: [HACKERS] logical decoding of two-phase transactions

2019-01-04 Thread Nikhil Sontakke
dated patch set. Regards, Nikhil > regards > > -- > Tomas Vondra http://www.2ndQuadrant.com > PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Nikhil Sontakke 2ndQuadrant - PostgreSQL Solutions for the Enterprise https://www.2ndQuadran

Re: [HACKERS] logical decoding of two-phase transactions

2019-01-04 Thread Nikhil Sontakke
Hi Arseny, > I hadn't checked whether my concerns where addressed in the latest > version though. > I'd like to believe that the latest patch set tries to address some (if not all) of your concerns. Can you please take a look and let me know? Regards, Nikhil -- Nikhil Sontakke 2n

Re: [HACKERS] PATCH: Batch/pipelining support for libpq

2019-08-30 Thread Nikhil Sontakke
ortable macros for the same. Please let me know on what we think of the above. Regards, Nikhil -- Nikhil Sontakke 2ndQuadrant - PostgreSQL Solutions for the Enterprise https://www.2ndQuadrant.com/ 0002-libpq_batch_tests_community_master.v17.patch Description: Binary data 0001-libpq_batch_supp