Dear Dilip,
> I was just going through the commit messages of all the patches, I
> could not understand the last line of below paragraph in v3-0004, what
> do you mean by the last line which says "after which the leader
> updates the
> hash entry with the current xid"?
>
> "The leader maintains a local hash table, using the remote change's replica
> identity column values and relid as keys, with remote transaction IDs as values.
> Before sending changes to the parallel apply worker, the leader computes a hash
> using RI key values and the relid of the current change to search the hash
> table. If an existing entry is found, the leader tells the parallel worker
> to wait for the remote xid in the hash entry, after which the leader updates the
> hash entry with the current xid."
This meant if two transactions had changes for the same RI, lastly committed
transaction's XID could be stored here. In other words, each local hash entry always
has the latest XID which modifies a key (RI).
Assuming that there are three transactions T1->T2->T3 and they modify the same
tuple. When subscriber applies T3, it should wait till T2 is committed, not T1.
XID of the entry should be updated for implementing it.
I tried to rephrase that line a bit, how do you feel? All patches are attached
to keep CI happy.
Best regards,
Hayato Kuroda
FUJITSU LIMITED