aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/catalog/system_views.sql5
-rw-r--r--src/backend/replication/logical/reorderbuffer.c12
-rw-r--r--src/backend/replication/walsender.c43
3 files changed, 3 insertions, 57 deletions
diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql
index d1177c6b57e..76154a8d5f2 100644
--- a/src/backend/catalog/system_views.sql
+++ b/src/backend/catalog/system_views.sql
@@ -785,10 +785,7 @@ CREATE VIEW pg_stat_replication AS
W.replay_lag,
W.sync_priority,
W.sync_state,
- W.reply_time,
- W.spill_txns,
- W.spill_count,
- W.spill_bytes
+ W.reply_time
FROM pg_stat_get_activity(NULL) AS S
JOIN pg_stat_get_wal_senders() AS W ON (S.pid = W.pid)
LEFT JOIN pg_authid AS U ON (S.usesysid = U.oid);
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 7afa2271bd8..52519326690 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -317,10 +317,6 @@ ReorderBufferAllocate(void)
buffer->outbufsize = 0;
buffer->size = 0;
- buffer->spillCount = 0;
- buffer->spillTxns = 0;
- buffer->spillBytes = 0;
-
buffer->current_restart_decoding_lsn = InvalidXLogRecPtr;
dlist_init(&buffer->toplevel_by_lsn);
@@ -2418,7 +2414,6 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
int fd = -1;
XLogSegNo curOpenSegNo = 0;
Size spilled = 0;
- Size size = txn->size;
elog(DEBUG2, "spill %u changes in XID %u to disk",
(uint32) txn->nentries_mem, txn->xid);
@@ -2477,13 +2472,6 @@ ReorderBufferSerializeTXN(ReorderBuffer *rb, ReorderBufferTXN *txn)
spilled++;
}
- /* update the statistics */
- rb->spillCount += 1;
- rb->spillBytes += size;
-
- /* Don't consider already serialized transactions. */
- rb->spillTxns += rbtxn_is_serialized(txn) ? 0 : 1;
-
Assert(spilled == txn->nentries_mem);
Assert(dlist_is_empty(&txn->changes));
txn->nentries_mem = 0;
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index e2477c47e0a..136e9c6585c 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -254,7 +254,6 @@ static bool TransactionIdInRecentPast(TransactionId xid, uint32 epoch);
static void WalSndSegmentOpen(XLogReaderState *state, XLogSegNo nextSegNo,
TimeLineID *tli_p);
-static void UpdateSpillStats(LogicalDecodingContext *ctx);
/* Initialize walsender process before entering the main command loop */
@@ -1348,8 +1347,7 @@ WalSndWriteData(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid,
/*
* LogicalDecodingContext 'update_progress' callback.
*
- * Write the current position to the lag tracker (see XLogSendPhysical),
- * and update the spill statistics.
+ * Write the current position to the lag tracker (see XLogSendPhysical).
*/
static void
WalSndUpdateProgress(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId xid)
@@ -1368,11 +1366,6 @@ WalSndUpdateProgress(LogicalDecodingContext *ctx, XLogRecPtr lsn, TransactionId
LagTrackerWrite(lsn, now);
sendTime = now;
-
- /*
- * Update statistics about transactions that spilled to disk.
- */
- UpdateSpillStats(ctx);
}
/*
@@ -2418,9 +2411,6 @@ InitWalSenderSlot(void)
walsnd->sync_standby_priority = 0;
walsnd->latch = &MyProc->procLatch;
walsnd->replyTime = 0;
- walsnd->spillTxns = 0;
- walsnd->spillCount = 0;
- walsnd->spillBytes = 0;
SpinLockRelease(&walsnd->mutex);
/* don't need the lock anymore */
MyWalSnd = (WalSnd *) walsnd;
@@ -3256,7 +3246,7 @@ offset_to_interval(TimeOffset offset)
Datum
pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
{
-#define PG_STAT_GET_WAL_SENDERS_COLS 15
+#define PG_STAT_GET_WAL_SENDERS_COLS 12
ReturnSetInfo *rsinfo = (ReturnSetInfo *) fcinfo->resultinfo;
TupleDesc tupdesc;
Tuplestorestate *tupstore;
@@ -3310,9 +3300,6 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
int pid;
WalSndState state;
TimestampTz replyTime;
- int64 spillTxns;
- int64 spillCount;
- int64 spillBytes;
bool is_sync_standby;
Datum values[PG_STAT_GET_WAL_SENDERS_COLS];
bool nulls[PG_STAT_GET_WAL_SENDERS_COLS];
@@ -3336,9 +3323,6 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
applyLag = walsnd->applyLag;
priority = walsnd->sync_standby_priority;
replyTime = walsnd->replyTime;
- spillTxns = walsnd->spillTxns;
- spillCount = walsnd->spillCount;
- spillBytes = walsnd->spillBytes;
SpinLockRelease(&walsnd->mutex);
/*
@@ -3436,11 +3420,6 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
nulls[11] = true;
else
values[11] = TimestampTzGetDatum(replyTime);
-
- /* spill to disk */
- values[12] = Int64GetDatum(spillTxns);
- values[13] = Int64GetDatum(spillCount);
- values[14] = Int64GetDatum(spillBytes);
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
@@ -3677,21 +3656,3 @@ LagTrackerRead(int head, XLogRecPtr lsn, TimestampTz now)
Assert(time != 0);
return now - time;
}
-
-static void
-UpdateSpillStats(LogicalDecodingContext *ctx)
-{
- ReorderBuffer *rb = ctx->reorder;
-
- elog(DEBUG2, "UpdateSpillStats: updating stats %p %lld %lld %lld",
- rb,
- (long long) rb->spillTxns,
- (long long) rb->spillCount,
- (long long) rb->spillBytes);
-
- SpinLockAcquire(&MyWalSnd->mutex);
- MyWalSnd->spillTxns = rb->spillTxns;
- MyWalSnd->spillCount = rb->spillCount;
- MyWalSnd->spillBytes = rb->spillBytes;
- SpinLockRelease(&MyWalSnd->mutex);
-}