Skip to content

Commit 3ab8cf9

Browse files
committed
Remove GlobalVisTestNonRemovable[Full]Horizon, not used anymore
GlobalVisTestNonRemovableHorizon() was only used for the implementation of snapshot_too_old, which was removed in f691f5b. As using GlobalVisTestNonRemovableHorizon() is not particularly efficient, no new uses for it should be added. Therefore remove. Discussion: https://postgr.es/m/20240415185720.q4dg4dlcyvvrabz4@awork3.anarazel.de
1 parent 0c2f555 commit 3ab8cf9

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

src/backend/storage/ipc/procarray.c

-30
Original file line numberDiff line numberDiff line change
@@ -4262,36 +4262,6 @@ GlobalVisTestIsRemovableXid(GlobalVisState *state, TransactionId xid)
42624262
return GlobalVisTestIsRemovableFullXid(state, fxid);
42634263
}
42644264

4265-
/*
4266-
* Return FullTransactionId below which all transactions are not considered
4267-
* running anymore.
4268-
*
4269-
* Note: This is less efficient than testing with
4270-
* GlobalVisTestIsRemovableFullXid as it likely requires building an accurate
4271-
* cutoff, even in the case all the XIDs compared with the cutoff are outside
4272-
* [maybe_needed, definitely_needed).
4273-
*/
4274-
FullTransactionId
4275-
GlobalVisTestNonRemovableFullHorizon(GlobalVisState *state)
4276-
{
4277-
/* acquire accurate horizon if not already done */
4278-
if (GlobalVisTestShouldUpdate(state))
4279-
GlobalVisUpdate();
4280-
4281-
return state->maybe_needed;
4282-
}
4283-
4284-
/* Convenience wrapper around GlobalVisTestNonRemovableFullHorizon */
4285-
TransactionId
4286-
GlobalVisTestNonRemovableHorizon(GlobalVisState *state)
4287-
{
4288-
FullTransactionId cutoff;
4289-
4290-
cutoff = GlobalVisTestNonRemovableFullHorizon(state);
4291-
4292-
return XidFromFullTransactionId(cutoff);
4293-
}
4294-
42954265
/*
42964266
* Convenience wrapper around GlobalVisTestFor() and
42974267
* GlobalVisTestIsRemovableFullXid(), see their comments.

src/include/utils/snapmgr.h

-2
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ typedef struct GlobalVisState GlobalVisState;
107107
extern GlobalVisState *GlobalVisTestFor(Relation rel);
108108
extern bool GlobalVisTestIsRemovableXid(GlobalVisState *state, TransactionId xid);
109109
extern bool GlobalVisTestIsRemovableFullXid(GlobalVisState *state, FullTransactionId fxid);
110-
extern FullTransactionId GlobalVisTestNonRemovableFullHorizon(GlobalVisState *state);
111-
extern TransactionId GlobalVisTestNonRemovableHorizon(GlobalVisState *state);
112110
extern bool GlobalVisCheckRemovableXid(Relation rel, TransactionId xid);
113111
extern bool GlobalVisCheckRemovableFullXid(Relation rel, FullTransactionId fxid);
114112

0 commit comments

Comments
 (0)