mirror of
https://github.com/postgres/postgres.git
synced 2025-07-14 08:21:07 +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:
@ -746,9 +746,10 @@ DecodeCommit(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the decoding stats at transaction prepare/commit/abort. It is
|
||||
* not clear that sending more or less frequently than this would be
|
||||
* better.
|
||||
* Update the decoding stats at transaction prepare/commit/abort.
|
||||
* Additionally we send the stats when we spill or stream the changes to
|
||||
* avoid losing them in case the decoding is interrupted. It is not clear
|
||||
* that sending more or less frequently than this would be better.
|
||||
*/
|
||||
UpdateDecodingStats(ctx);
|
||||
}
|
||||
@ -828,9 +829,10 @@ DecodePrepare(LogicalDecodingContext *ctx, XLogRecordBuffer *buf,
|
||||
ReorderBufferPrepare(ctx->reorder, xid, parsed->twophase_gid);
|
||||
|
||||
/*
|
||||
* Update the decoding stats at transaction prepare/commit/abort. It is
|
||||
* not clear that sending more or less frequently than this would be
|
||||
* better.
|
||||
* Update the decoding stats at transaction prepare/commit/abort.
|
||||
* Additionally we send the stats when we spill or stream the changes to
|
||||
* avoid losing them in case the decoding is interrupted. It is not clear
|
||||
* that sending more or less frequently than this would be better.
|
||||
*/
|
||||
UpdateDecodingStats(ctx);
|
||||
}
|
||||
|
Reference in New Issue
Block a user