Remove GlobalVisTestNonRemovable[Full]Horizon, not used anymore
authorAndres Freund <[email protected]>
Wed, 17 Apr 2024 18:21:17 +0000 (11:21 -0700)
committerAndres Freund <[email protected]>
Wed, 17 Apr 2024 18:21:17 +0000 (11:21 -0700)
GlobalVisTestNonRemovableHorizon() was only used for the implementation of
snapshot_too_old, which was removed in f691f5b80a8. As using
GlobalVisTestNonRemovableHorizon() is not particularly efficient, no new uses
for it should be added. Therefore remove.

Discussion: https://postgr.es/m/20240415185720[email protected]

src/backend/storage/ipc/procarray.c
src/include/utils/snapmgr.h

index 88a6d504dffd11aa0db4e6e1ea014516e6ba29af..1a83c4220b2c1a59b1bf5bf2a13bec9e996e5b97 100644 (file)
@@ -4262,36 +4262,6 @@ GlobalVisTestIsRemovableXid(GlobalVisState *state, TransactionId xid)
    return GlobalVisTestIsRemovableFullXid(state, fxid);
 }
 
-/*
- * Return FullTransactionId below which all transactions are not considered
- * running anymore.
- *
- * Note: This is less efficient than testing with
- * GlobalVisTestIsRemovableFullXid as it likely requires building an accurate
- * cutoff, even in the case all the XIDs compared with the cutoff are outside
- * [maybe_needed, definitely_needed).
- */
-FullTransactionId
-GlobalVisTestNonRemovableFullHorizon(GlobalVisState *state)
-{
-   /* acquire accurate horizon if not already done */
-   if (GlobalVisTestShouldUpdate(state))
-       GlobalVisUpdate();
-
-   return state->maybe_needed;
-}
-
-/* Convenience wrapper around GlobalVisTestNonRemovableFullHorizon */
-TransactionId
-GlobalVisTestNonRemovableHorizon(GlobalVisState *state)
-{
-   FullTransactionId cutoff;
-
-   cutoff = GlobalVisTestNonRemovableFullHorizon(state);
-
-   return XidFromFullTransactionId(cutoff);
-}
-
 /*
  * Convenience wrapper around GlobalVisTestFor() and
  * GlobalVisTestIsRemovableFullXid(), see their comments.
index 4cf79085f4dd9822661d36a77da796a8cf20f6be..9398a84051c5e864db1ea0032c83a6491f9801ab 100644 (file)
@@ -107,8 +107,6 @@ typedef struct GlobalVisState GlobalVisState;
 extern GlobalVisState *GlobalVisTestFor(Relation rel);
 extern bool GlobalVisTestIsRemovableXid(GlobalVisState *state, TransactionId xid);
 extern bool GlobalVisTestIsRemovableFullXid(GlobalVisState *state, FullTransactionId fxid);
-extern FullTransactionId GlobalVisTestNonRemovableFullHorizon(GlobalVisState *state);
-extern TransactionId GlobalVisTestNonRemovableHorizon(GlobalVisState *state);
 extern bool GlobalVisCheckRemovableXid(Relation rel, TransactionId xid);
 extern bool GlobalVisCheckRemovableFullXid(Relation rel, FullTransactionId fxid);