vignesh C <vignesh21(at)gmail(dot)com> writes:
> I agree with your analysis. I was able to reproduce the issue by
> delaying the invalidation of the subscription until the walsender
> finished decoding the INSERT operation following the ALTER
> SUBSCRIPTION through a debugger and using the lsn from the pg_waldump
> of the INSERT after the ALTER SUBSCRIPTION.
Can you be a little more specific about how you reproduced this?
I tried inserting sleep() calls in various likely-looking spots
and could not get a failure that way.
regards, tom lane