diff options
author | Fujii Masao <fujii@postgresql.org> | 2016-04-13 04:36:29 +0900 |
---|---|---|
committer | Fujii Masao <fujii@postgresql.org> | 2016-04-13 04:36:29 +0900 |
commit | 46d73e0d65eef19e25bb0d31f1e5c23ff40a3444 (patch) | |
tree | 4bb63dd72ea95575cbf21c0b6bccfa4083520032 /src | |
parent | f1f01de145d0aaca80e6cf8b2ccb7e7f4ed1ad02 (diff) | |
download | postgresql-46d73e0d65eef19e25bb0d31f1e5c23ff40a3444.tar.gz postgresql-46d73e0d65eef19e25bb0d31f1e5c23ff40a3444.zip |
Remove unused function GetOldestWALSendPointer from walsender code.
That unused function was introduced as a sample because synchronous
replication or replication monitoring tools might need it in the future.
Recently commit 989be08 added the function SyncRepGetOldestSyncRecPtr
which provides almost the same functionality for multiple synchronous
standbys feature. So it's time to remove that unused sample function.
This commit does that.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/walsender.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c index e4a0119c5e3..81d3d285c90 100644 --- a/src/backend/replication/walsender.c +++ b/src/backend/replication/walsender.c @@ -2938,44 +2938,3 @@ WalSndKeepaliveIfNecessary(TimestampTz now) WalSndShutdown(); } } - -/* - * This isn't currently used for anything. Monitoring tools might be - * interested in the future, and we'll need something like this in the - * future for synchronous replication. - */ -#ifdef NOT_USED -/* - * Returns the oldest Send position among walsenders. Or InvalidXLogRecPtr - * if none. - */ -XLogRecPtr -GetOldestWALSendPointer(void) -{ - XLogRecPtr oldest = {0, 0}; - int i; - bool found = false; - - for (i = 0; i < max_wal_senders; i++) - { - WalSnd *walsnd = &WalSndCtl->walsnds[i]; - XLogRecPtr recptr; - - if (walsnd->pid == 0) - continue; - - SpinLockAcquire(&walsnd->mutex); - recptr = walsnd->sentPtr; - SpinLockRelease(&walsnd->mutex); - - if (recptr.xlogid == 0 && recptr.xrecoff == 0) - continue; - - if (!found || recptr < oldest) - oldest = recptr; - found = true; - } - return oldest; -} - -#endif |