On Tue, Dec 1, 2020 at 6:26 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> To skip it, we need to send GID in begin message and then on
> subscriber-side, check if the prepared xact already exists, if so then
> set a flag. The flag needs to be set in begin/start_stream and reset
> in stop_stream/commit/abort. Using the flag, we can skip the entire
> contents of the prepared xact. In ReorderFuffer-side also, we need to
> get and set GID in txn even when we skip it because we need to send
> the same at commit time. In this solution, we won't be able to send it
> during normal start_stream because by that time we won't know GID and
> I think that won't be required. Note that this is only required when
> we skipped sending prepare, otherwise, we just need to send
> Commit-Prepared at commit time.
I have implemented these changes and tested the fix using the test
setup I had shared above and it seems to be working fine.
I have also tested restarts that simulate duplicate prepares being
sent by the publisher and verified that it is handled correctly by the
subscriber.
Do have a look at the changes and let me know if you have any comments.
regards,
Ajin Cherian
Fujitsu Australia