diff options
| author | Andres Freund | 2017-06-19 01:48:22 +0000 |
|---|---|---|
| committer | Andres Freund | 2017-06-19 02:14:09 +0000 |
| commit | a27c566c77f86ac61633da05a284c1cc4a8fa389 (patch) | |
| tree | 35a69e2717951109f50958e74a8cb9b29f9dd120 /src/include/replication | |
| parent | 6338b50b933520551d2d6b6a2e5b7de8e53fe9e2 (diff) | |
Fix leaking of small spilled subtransactions during logical decoding.
When, during logical decoding, a transaction gets too big, it's
contents get spilled to disk. Not just the top-transaction gets
spilled, but *also* all of its subtransactions, even if they're not
that large themselves. Unfortunately we didn't clean up
such small spilled subtransactions from disk.
Fix that, by keeping better track of whether a transaction has been
spilled to disk.
Author: Andres Freund
Reported-By: Dmitriy Sarafannikov, FabrÃzio de Royes Mello
Discussion:
https://postgr.es/m/1457621358.355011041@f382.i.mail.ru
https://postgr.es/m/CAFcNs+qNMhNYii4nxpO6gqsndiyxNDYV0S=JNq0v_sEE+9PHXg@mail.gmail.com
Backpatch: 9.4-, where logical decoding was introduced
Diffstat (limited to 'src/include/replication')
| -rw-r--r-- | src/include/replication/reorderbuffer.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h index 9092c9b4ff6..2ce2c2189f6 100644 --- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.h @@ -194,6 +194,15 @@ typedef struct ReorderBufferTXN uint64 nentries_mem; /* + * Has this transaction been spilled to disk? It's not always possible to + * deduce that fact by comparing nentries with nentries_mem, because + * e.g. subtransactions of a large transaction might get serialized + * together with the parent - if they're restored to memory they'd have + * nentries_mem == nentries. + */ + bool serialized; + + /* * List of ReorderBufferChange structs, including new Snapshots and new * CommandIds */ |
