Remove incorrect assertion in reorderbuffer.c.
authorAmit Kapila <akapila@postgresql.org>
Fri, 4 Dec 2020 08:24:50 +0000 (13:54 +0530)
committerAmit Kapila <akapila@postgresql.org>
Fri, 4 Dec 2020 08:24:50 +0000 (13:54 +0530)
commit8ae4ef4fb0e0331f02c4615182600546c8e5c4d4
tree4de7d9c99d8fc7b72d5eec3cee914514c6bd04a2
parentbd94a9c04e04bb3b626e88981a50fcca2bd99d60
Remove incorrect assertion in reorderbuffer.c.

We start recording changes in ReorderBufferTXN even before we reach
SNAPBUILD_CONSISTENT state so that if the commit is encountered after
reaching that we should be able to send the changes of the entire transaction.
Now, while recording changes if the reorder buffer memory has exceeded
logical_decoding_work_mem then we can start streaming if it is allowed and
we haven't yet streamed that data. However, we must not allow streaming to
start unless the snapshot has reached SNAPBUILD_CONSISTENT state.

In passing, improve the comments atop ReorderBufferResetTXN to mention the
case when we need to continue streaming after getting an error.

Author: Amit Kapila
Reviewed-by: Dilip Kumar
Discussion: http://postgr.es/m/CAA4eK1KoOH0byboyYY40NBcC7Fe812trwTa+WY3jQF7WQWZbQg@mail.gmail.com
src/backend/replication/logical/reorderbuffer.c