Unverified Commit c3418105 authored by Arunprasad Rajkumar's avatar Arunprasad Rajkumar Committed by GitHub
Browse files

Rollback incomplete txns on graceful exit (#544)



Before this update, exiting the process (either reaching ENDPOS or user-initiated abort like Ctrl-C) could leave us in the midst of an unfinished transaction. Upon resumption, PostgreSQL begins streaming from a consistent point, which might be the start of this incomplete transaction or from an earlier one. Our previous method tried to bypass all earlier messages until hitting the final message of the incomplete transaction, but this approach had its shortcomings, especially when the messages originated from several transactions back.

This commit introduces a more straightforward solution. Now, if the process is aborted and the last transaction is not complete, we'll issue a rollback command for that transaction. This ensures a clean and consistent state for a graceful exit and subsequent resumption.

Signed-off-by: default avatarArunprasad Rajkumar <ar.arunprasad@gmail.com>
parent 00d7c571
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment