Re: Found issues related with logical replication and 2PC

2024-08-08 Thread Amit Kapila
On Fri, Aug 9, 2024 at 10:34 AM Hayato Kuroda (Fujitsu) wrote: > > > > > The code changes look mostly good to me. I have changed/added a few > > comments in the attached modified version. > > > > Thanks for updating the patch! It LGTM. I've tested your patch and confirmed > it did not cause the da

RE: Found issues related with logical replication and 2PC

2024-08-08 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > > The code changes look mostly good to me. I have changed/added a few > comments in the attached modified version. > Thanks for updating the patch! It LGTM. I've tested your patch and confirmed it did not cause the data loss. I used the source which was applied v3 and additional fix

Re: Found issues related with logical replication and 2PC

2024-08-08 Thread shveta malik
On Thu, Aug 8, 2024 at 5:53 PM Amit Kapila wrote: > > On Thu, Aug 8, 2024 at 2:37 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Thanks for discussing! > > > > I reported the issue because 1) I feared the risk of data loss and 2) simply > > because the coding looked incorrect. However, per discussio

Re: Found issues related with logical replication and 2PC

2024-08-08 Thread Amit Kapila
On Thu, Aug 8, 2024 at 2:37 PM Hayato Kuroda (Fujitsu) wrote: > > Thanks for discussing! > > I reported the issue because 1) I feared the risk of data loss and 2) simply > because the coding looked incorrect. However, per discussion, I understood > that > it wouldn't lead to loss, and adding a gl

RE: Found issues related with logical replication and 2PC

2024-08-08 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Shveta, Thanks for discussing! I reported the issue because 1) I feared the risk of data loss and 2) simply because the coding looked incorrect. However, per discussion, I understood that it wouldn't lead to loss, and adding a global variable was unacceptable in this case. I modified t

Re: Found issues related with logical replication and 2PC

2024-08-08 Thread shveta malik
On Thu, Aug 8, 2024 at 9:53 AM Amit Kapila wrote: > > On Thu, Aug 8, 2024 at 8:54 AM shveta malik wrote: > > > > On Wed, Aug 7, 2024 at 5:43 PM Amit Kapila wrote: > > > > > So, if my > > > analysis is correct, this shouldn't be a bug and ideally, we should > > > update local_end LSN as InvalidXL

RE: Found issues related with logical replication and 2PC

2024-08-07 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > Can we start a separate thread to issue 2? I understand that this one > is also related to two_phase but since both are different issues it is > better to discuss in separate threads. This will also help us refer to > the discussion in future if required. You are right, we should dis

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread Amit Kapila
On Wed, Jul 24, 2024 at 12:25 PM Hayato Kuroda (Fujitsu) wrote: > > While creating a patch which allows ALTER SUBSCRIPTION SET (two_phase) [1], > we found some issues related with logical replication and two_phase. I think > this > can happen not only HEAD but PG14+, but for now I shared patches

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread Amit Kapila
On Thu, Aug 8, 2024 at 8:54 AM shveta malik wrote: > > On Wed, Aug 7, 2024 at 5:43 PM Amit Kapila wrote: > > > So, if my > > analysis is correct, this shouldn't be a bug and ideally, we should > > update local_end LSN as InvalidXLogRecPtr and add appropriate > > comments. > > Okay, we can do that

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread shveta malik
On Wed, Aug 7, 2024 at 5:43 PM Amit Kapila wrote: > > On Wed, Aug 7, 2024 at 3:32 PM Amit Kapila wrote: > > > > I also think so. Additionally, I feel a test case (or some description > > of the bug that can arise) should be provided for issue-1. > > > > IIUC, the problem could be that we would en

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread Amit Kapila
On Wed, Aug 7, 2024 at 3:32 PM Amit Kapila wrote: > > I also think so. Additionally, I feel a test case (or some description > of the bug that can arise) should be provided for issue-1. > IIUC, the problem could be that we would end up updating the wrong local_end LSN in lsn_mappings via store_fl

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread Amit Kapila
On Wed, Aug 7, 2024 at 12:38 PM shveta malik wrote: > > On Wed, Jul 24, 2024 at 12:25 PM Hayato Kuroda (Fujitsu) > wrote: > > > > Issue #1 > > > > When handling a PREPARE message, the subscriber mistook the wrong lsn > > position > > (the end position of the last commit) as the end position of t

Re: Found issues related with logical replication and 2PC

2024-08-07 Thread shveta malik
On Wed, Jul 24, 2024 at 12:25 PM Hayato Kuroda (Fujitsu) wrote: > > Hi hackers, > > While creating a patch which allows ALTER SUBSCRIPTION SET (two_phase) [1], > we found some issues related with logical replication and two_phase. I think > this > can happen not only HEAD but PG14+, but for now I

Found issues related with logical replication and 2PC

2024-07-23 Thread Hayato Kuroda (Fujitsu)
Hi hackers, While creating a patch which allows ALTER SUBSCRIPTION SET (two_phase) [1], we found some issues related with logical replication and two_phase. I think this can happen not only HEAD but PG14+, but for now I shared patches for HEAD. Issue #1 When handling a PREPARE message, the subs