Re: Reset snapshot export state on the transaction abort

2021-10-18 Thread Dilip Kumar
On Mon, Oct 18, 2021 at 8:51 AM Michael Paquier wrote: > > On Sun, Oct 17, 2021 at 09:33:48AM +0900, Michael Paquier wrote: > > That seems logically fine. I'll check that tomorrow. > > And that looks indeed fine. I have adjusted a couple of things, and > backpatched the fix. Thanks! -- Regar

Re: Reset snapshot export state on the transaction abort

2021-10-17 Thread Michael Paquier
On Sun, Oct 17, 2021 at 09:33:48AM +0900, Michael Paquier wrote: > That seems logically fine. I'll check that tomorrow. And that looks indeed fine. I have adjusted a couple of things, and backpatched the fix. -- Michael signature.asc Description: PGP signature

Re: Reset snapshot export state on the transaction abort

2021-10-16 Thread Michael Paquier
On Sat, Oct 16, 2021 at 08:31:36AM -0700, Zhihong Yu wrote: > On Sat, Oct 16, 2021 at 3:10 AM Dilip Kumar wrote: >> On Sat, Oct 16, 2021 at 9:13 AM Michael Paquier >> wrote: >>> One solution would be as simple as saving >>> SavedResourceOwnerDuringExport into a temporary variable before >>> calli

Re: Reset snapshot export state on the transaction abort

2021-10-16 Thread Zhihong Yu
On Sat, Oct 16, 2021 at 3:10 AM Dilip Kumar wrote: > On Sat, Oct 16, 2021 at 9:13 AM Michael Paquier > wrote: > > > > While double-checking this stuff, I have noticed something that's > > wrong in the patch when a command that follows a > > CREATE_REPLICATION_SLOT query resets SnapBuildClearExpo

Re: Reset snapshot export state on the transaction abort

2021-10-16 Thread Dilip Kumar
On Sat, Oct 16, 2021 at 9:13 AM Michael Paquier wrote: > > While double-checking this stuff, I have noticed something that's > wrong in the patch when a command that follows a > CREATE_REPLICATION_SLOT query resets SnapBuildClearExportedSnapshot(). > Once the slot is created, the WAL sender is in

Re: Reset snapshot export state on the transaction abort

2021-10-15 Thread Michael Paquier
On Thu, Oct 14, 2021 at 02:58:55PM +0530, Dilip Kumar wrote: > On Thu, Oct 14, 2021 at 12:24 PM Michael Paquier wrote: >> Yes, you are right here. I did not remember the semantics this relies >> on. I have played more with the patch, reviewed the whole, and the >> fields you are resetting as par

Re: Reset snapshot export state on the transaction abort

2021-10-14 Thread Dilip Kumar
On Thu, Oct 14, 2021 at 12:24 PM Michael Paquier wrote: > > On Wed, Oct 13, 2021 at 10:53:24AM +0530, Dilip Kumar wrote: > > Actually, it is not required because 1) Snapshot export can not be > > allowed within a transaction block, basically, it starts its own > > transaction block and aborts that

Re: Reset snapshot export state on the transaction abort

2021-10-13 Thread Michael Paquier
On Wed, Oct 13, 2021 at 10:53:24AM +0530, Dilip Kumar wrote: > Actually, it is not required because 1) Snapshot export can not be > allowed within a transaction block, basically, it starts its own > transaction block and aborts that while executing any next replication > command see SnapBuildClearE

Re: Reset snapshot export state on the transaction abort

2021-10-12 Thread Dilip Kumar
On Wed, Oct 13, 2021 at 10:17 AM Michael Paquier wrote: > > On Mon, Oct 11, 2021 at 08:46:32PM +0530, Dilip Kumar wrote: > > As reported at [1], if the transaction is aborted during export > > snapshot then ExportInProgress and SavedResourceOwnerDuringExport are > > not getting reset and that is t

Re: Reset snapshot export state on the transaction abort

2021-10-12 Thread Michael Paquier
On Mon, Oct 11, 2021 at 08:46:32PM +0530, Dilip Kumar wrote: > As reported at [1], if the transaction is aborted during export > snapshot then ExportInProgress and SavedResourceOwnerDuringExport are > not getting reset and that is throwing an error > "clearing exported snapshot in wrong transaction