diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-17 18:00:39 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2020-01-17 18:00:39 -0300 |
commit | bc2140627ff14c207a0af990b8ea3860e188e6b1 (patch) | |
tree | bada6527a97c36d16acb9c26e6ddc3239980c611 /src/include | |
parent | 162c951dfe8f0a894f2832e04aacfc3a0a7bf50c (diff) | |
download | postgresql-bc2140627ff14c207a0af990b8ea3860e188e6b1.tar.gz postgresql-bc2140627ff14c207a0af990b8ea3860e188e6b1.zip |
Set ReorderBufferTXN->final_lsn more eagerly
... specifically, set it incrementally as each individual change is
spilled down to disk. This way, it is set correctly when the
transaction disappears without trace, ie. without leaving an XACT_ABORT
wal record. (This happens when the server crashes midway through a
transaction.)
Failing to have final_lsn prevents ReorderBufferRestoreCleanup() from
working, since it needs the final_lsn in order to know the endpoint of
its iteration through spilled files.
Commit df9f682c7bf8 already tried to fix the problem, but it didn't set
the final_lsn in all cases. Revert that, since it's no longer needed.
Author: Vignesh C
Reviewed-by: Amit Kapila, Dilip Kumar
Discussion: https://postgr.es/m/CALDaNm2CLk+K9JDwjYST0sPbGg5AQdvhUt0jbKyX_HdAE0jk3A@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/replication/reorderbuffer.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h index 4c06a78c11f..49df12a64f4 100644 --- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.h @@ -179,9 +179,10 @@ typedef struct ReorderBufferTXN * * prepared transaction commit * * plain abort record * * prepared transaction abort - * * error during decoding - * * for a crashed transaction, the LSN of the last change, regardless of - * what it was. + * + * This can also become set to earlier values than transaction end when + * a transaction is spilled to disk; specifically it's set to the LSN of + * the latest change written to disk so far. * ---- */ XLogRecPtr final_lsn; |