mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Update replication statistics after every stream/spill.
Currently, replication slot statistics are updated at prepare, commit, and rollback. Now, if the transaction is interrupted the stats might not get updated. Fixed this by updating replication statistics after every stream/spill. In passing update the docs to change the description of some of the slot stats. Author: Vignesh C, Sawada Masahiko Reviewed-by: Amit Kapila Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de
This commit is contained in:
@ -3559,6 +3559,9 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
|
||||
|
||||
/* don't consider already serialized transactions */
|
||||
rb->spillTxns += (rbtxn_is_serialized(txn) || rbtxn_is_serialized_clear(txn)) ? 0 : 1;
|
||||
|
||||
/* update the decoding stats */
|
||||
UpdateDecodingStats((LogicalDecodingContext *) rb->private_data);
|
||||
}
|
||||
|
||||
Assert(spilled == txn->nentries_mem);
|
||||
@ -3928,6 +3931,9 @@ ReorderBufferStreamTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
|
||||
/* Don't consider already streamed transaction. */
|
||||
rb->streamTxns += (txn_is_streamed) ? 0 : 1;
|
||||
|
||||
/* update the decoding stats */
|
||||
UpdateDecodingStats((LogicalDecodingContext *) rb->private_data);
|
||||
|
||||
Assert(dlist_is_empty(&txn->changes));
|
||||
Assert(txn->nentries == 0);
|
||||
Assert(txn->nentries_mem == 0);
|
||||
|
Reference in New Issue
Block a user