summaryrefslogtreecommitdiff
path: root/src/backend/storage/lmgr/predicate.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2022-04-12 14:45:23 -0400
committerRobert Haas <rhaas@postgresql.org>2022-04-12 14:45:23 -0400
commit7fc0e7de9fb8306e84d1c15211aba4308f694455 (patch)
treece8d0213123959bce52699e8e8d837d46758a2f6 /src/backend/storage/lmgr/predicate.c
parent2c9381840fe2d6d1c3179350493fe5fd3dcf90b5 (diff)
Revert the addition of GetMaxBackends() and related stuff.
This reverts commits 0147fc7, 4567596, aa64f23, and 5ecd018. There is no longer agreement that introducing this function was the right way to address the problem. The consensus now seems to favor trying to make a correct value for MaxBackends available to mdules executing their _PG_init() functions. Nathan Bossart Discussion: http://postgr.es/m/20220323045229.i23skfscdbvrsuxa@jrouhaud
Diffstat (limited to 'src/backend/storage/lmgr/predicate.c')
-rw-r--r--src/backend/storage/lmgr/predicate.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/lmgr/predicate.c b/src/backend/storage/lmgr/predicate.c
index e337aad5b24..25e7e4e37bf 100644
--- a/src/backend/storage/lmgr/predicate.c
+++ b/src/backend/storage/lmgr/predicate.c
@@ -257,7 +257,7 @@
(&MainLWLockArray[PREDICATELOCK_MANAGER_LWLOCK_OFFSET + (i)].lock)
#define NPREDICATELOCKTARGETENTS() \
- mul_size(max_predicate_locks_per_xact, add_size(GetMaxBackends(), max_prepared_xacts))
+ mul_size(max_predicate_locks_per_xact, add_size(MaxBackends, max_prepared_xacts))
#define SxactIsOnFinishedList(sxact) (!SHMQueueIsDetached(&((sxact)->finishedLink)))
@@ -1222,7 +1222,7 @@ InitPredicateLocks(void)
* Compute size for serializable transaction hashtable. Note these
* calculations must agree with PredicateLockShmemSize!
*/
- max_table_size = (GetMaxBackends() + max_prepared_xacts);
+ max_table_size = (MaxBackends + max_prepared_xacts);
/*
* Allocate a list to hold information on transactions participating in
@@ -1375,7 +1375,7 @@ PredicateLockShmemSize(void)
size = add_size(size, size / 10);
/* transaction list */
- max_table_size = GetMaxBackends() + max_prepared_xacts;
+ max_table_size = MaxBackends + max_prepared_xacts;
max_table_size *= 10;
size = add_size(size, PredXactListDataSize);
size = add_size(size, mul_size((Size) max_table_size,
@@ -1907,7 +1907,7 @@ GetSerializableTransactionSnapshotInt(Snapshot snapshot,
{
++(PredXact->WritableSxactCount);
Assert(PredXact->WritableSxactCount <=
- (GetMaxBackends() + max_prepared_xacts));
+ (MaxBackends + max_prepared_xacts));
}
MySerializableXact = sxact;
@@ -5111,7 +5111,7 @@ predicatelock_twophase_recover(TransactionId xid, uint16 info,
{
++(PredXact->WritableSxactCount);
Assert(PredXact->WritableSxactCount <=
- (GetMaxBackends() + max_prepared_xacts));
+ (MaxBackends + max_prepared_xacts));
}
/*