Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 746092a

Browse files
committed
pgindent run on access/transam/multixact.c
This file has been patched over and over, and the differences to master caused by pgindent are annoying enough that it seems saner to make the older branches look the same. Backpatch to 9.3, which is as far back as backpatching of bugfixes is necessary.
1 parent f051c16 commit 746092a

File tree

1 file changed

+53
-55
lines changed

1 file changed

+53
-55
lines changed

src/backend/access/transam/multixact.c

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ typedef struct mXactCacheEnt
306306
} mXactCacheEnt;
307307

308308
#define MAX_CACHE_ENTRIES 256
309-
static dlist_head MXactCache = DLIST_STATIC_INIT(MXactCache);
310-
static int MXactCacheMembers = 0;
309+
static dlist_head MXactCache = DLIST_STATIC_INIT(MXactCache);
310+
static int MXactCacheMembers = 0;
311311
static MemoryContext MXactContext = NULL;
312312

313313
#ifdef MULTIXACT_DEBUG
@@ -620,9 +620,9 @@ MultiXactIdSetOldestMember(void)
620620
* back. Which would be wrong.
621621
*
622622
* Note that a shared lock is sufficient, because it's enough to stop
623-
* someone from advancing nextMXact; and nobody else could be trying to
624-
* write to our OldestMember entry, only reading (and we assume storing
625-
* it is atomic.)
623+
* someone from advancing nextMXact; and nobody else could be trying
624+
* to write to our OldestMember entry, only reading (and we assume
625+
* storing it is atomic.)
626626
*/
627627
LWLockAcquire(MultiXactGenLock, LW_SHARED);
628628

@@ -970,7 +970,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
970970
*/
971971
if (!MultiXactIdPrecedes(result, MultiXactState->multiVacLimit) ||
972972
(MultiXactState->nextOffset - MultiXactState->oldestOffset
973-
> MULTIXACT_MEMBER_SAFE_THRESHOLD))
973+
> MULTIXACT_MEMBER_SAFE_THRESHOLD))
974974
{
975975
/*
976976
* For safety's sake, we release MultiXactGenLock while sending
@@ -1025,17 +1025,17 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
10251025
(errmsg_plural("database \"%s\" must be vacuumed before %u more MultiXactId is used",
10261026
"database \"%s\" must be vacuumed before %u more MultiXactIds are used",
10271027
multiWrapLimit - result,
1028-
oldest_datname,
1029-
multiWrapLimit - result),
1028+
oldest_datname,
1029+
multiWrapLimit - result),
10301030
errhint("Execute a database-wide VACUUM in that database.\n"
10311031
"You might also need to commit or roll back old prepared transactions.")));
10321032
else
10331033
ereport(WARNING,
10341034
(errmsg_plural("database with OID %u must be vacuumed before %u more MultiXactId is used",
10351035
"database with OID %u must be vacuumed before %u more MultiXactIds are used",
10361036
multiWrapLimit - result,
1037-
oldest_datoid,
1038-
multiWrapLimit - result),
1037+
oldest_datoid,
1038+
multiWrapLimit - result),
10391039
errhint("Execute a database-wide VACUUM in that database.\n"
10401040
"You might also need to commit or roll back old prepared transactions.")));
10411041
}
@@ -1194,14 +1194,14 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
11941194
*
11951195
* An ID older than MultiXactState->oldestMultiXactId cannot possibly be
11961196
* useful; it has already been removed, or will be removed shortly, by
1197-
* truncation. Returning the wrong values could lead
1198-
* to an incorrect visibility result. However, to support pg_upgrade we
1199-
* need to allow an empty set to be returned regardless, if the caller is
1200-
* willing to accept it; the caller is expected to check that it's an
1201-
* allowed condition (such as ensuring that the infomask bits set on the
1202-
* tuple are consistent with the pg_upgrade scenario). If the caller is
1203-
* expecting this to be called only on recently created multis, then we
1204-
* raise an error.
1197+
* truncation. Returning the wrong values could lead to an incorrect
1198+
* visibility result. However, to support pg_upgrade we need to allow an
1199+
* empty set to be returned regardless, if the caller is willing to accept
1200+
* it; the caller is expected to check that it's an allowed condition
1201+
* (such as ensuring that the infomask bits set on the tuple are
1202+
* consistent with the pg_upgrade scenario). If the caller is expecting
1203+
* this to be called only on recently created multis, then we raise an
1204+
* error.
12051205
*
12061206
* Conversely, an ID >= nextMXact shouldn't ever be seen here; if it is
12071207
* seen, it implies undetected ID wraparound has occurred. This raises a
@@ -1383,8 +1383,8 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
13831383

13841384
/*
13851385
* MultiXactHasRunningRemoteMembers
1386-
* Does the given multixact have still-live members from
1387-
* transactions other than our own?
1386+
* Does the given multixact have still-live members from
1387+
* transactions other than our own?
13881388
*/
13891389
bool
13901390
MultiXactHasRunningRemoteMembers(MultiXactId multi)
@@ -1935,7 +1935,7 @@ MaybeExtendOffsetSlru(void)
19351935

19361936
if (!SimpleLruDoesPhysicalPageExist(MultiXactOffsetCtl, pageno))
19371937
{
1938-
int slotno;
1938+
int slotno;
19391939

19401940
/*
19411941
* Fortunately for us, SimpleLruWritePage is already prepared to deal
@@ -2142,11 +2142,11 @@ MultiXactSetNextMXact(MultiXactId nextMulti,
21422142
* enough to contain the next value that would be created.
21432143
*
21442144
* We need to do this pretty early during the first startup in binary
2145-
* upgrade mode: before StartupMultiXact() in fact, because this routine is
2146-
* called even before that by StartupXLOG(). And we can't do it earlier
2147-
* than at this point, because during that first call of this routine we
2148-
* determine the MultiXactState->nextMXact value that MaybeExtendOffsetSlru
2149-
* needs.
2145+
* upgrade mode: before StartupMultiXact() in fact, because this routine
2146+
* is called even before that by StartupXLOG(). And we can't do it
2147+
* earlier than at this point, because during that first call of this
2148+
* routine we determine the MultiXactState->nextMXact value that
2149+
* MaybeExtendOffsetSlru needs.
21502150
*/
21512151
if (IsBinaryUpgrade)
21522152
MaybeExtendOffsetSlru();
@@ -2221,11 +2221,11 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
22212221

22222222
/*
22232223
* Determine the offset of the oldest multixact that might still be
2224-
* referenced. Normally, we can read the offset from the multixact itself,
2225-
* but there's an important special case: if there are no multixacts in
2226-
* existence at all, oldest_datminmxid obviously can't point to one. It
2227-
* will instead point to the multixact ID that will be assigned the next
2228-
* time one is needed.
2224+
* referenced. Normally, we can read the offset from the multixact
2225+
* itself, but there's an important special case: if there are no
2226+
* multixacts in existence at all, oldest_datminmxid obviously can't point
2227+
* to one. It will instead point to the multixact ID that will be
2228+
* assigned the next time one is needed.
22292229
*
22302230
* NB: oldest_dataminmxid is the oldest multixact that might still be
22312231
* referenced from a table, unlike in DetermineSafeOldestOffset, where we
@@ -2302,17 +2302,17 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid)
23022302
(errmsg_plural("database \"%s\" must be vacuumed before %u more MultiXactId is used",
23032303
"database \"%s\" must be vacuumed before %u more MultiXactIds are used",
23042304
multiWrapLimit - curMulti,
2305-
oldest_datname,
2306-
multiWrapLimit - curMulti),
2305+
oldest_datname,
2306+
multiWrapLimit - curMulti),
23072307
errhint("To avoid a database shutdown, execute a database-wide VACUUM in that database.\n"
23082308
"You might also need to commit or roll back old prepared transactions.")));
23092309
else
23102310
ereport(WARNING,
23112311
(errmsg_plural("database with OID %u must be vacuumed before %u more MultiXactId is used",
23122312
"database with OID %u must be vacuumed before %u more MultiXactIds are used",
23132313
multiWrapLimit - curMulti,
2314-
oldest_datoid,
2315-
multiWrapLimit - curMulti),
2314+
oldest_datoid,
2315+
multiWrapLimit - curMulti),
23162316
errhint("To avoid a database shutdown, execute a database-wide VACUUM in that database.\n"
23172317
"You might also need to commit or roll back old prepared transactions.")));
23182318
}
@@ -2539,10 +2539,9 @@ DetermineSafeOldestOffset(MultiXactId oldestMXact)
25392539
* obviously can't point to one. It will instead point to the multixact
25402540
* ID that will be assigned the next time one is needed.
25412541
*
2542-
* NB: oldestMXact should be the oldest multixact that still exists in
2543-
* the SLRU, unlike in SetMultiXactIdLimit, where we do this same
2544-
* computation based on the oldest value that might be referenced in a
2545-
* table.
2542+
* NB: oldestMXact should be the oldest multixact that still exists in the
2543+
* SLRU, unlike in SetMultiXactIdLimit, where we do this same computation
2544+
* based on the oldest value that might be referenced in a table.
25462545
*/
25472546
LWLockAcquire(MultiXactGenLock, LW_SHARED);
25482547
if (MultiXactState->nextMXact == oldestMXact)
@@ -2680,7 +2679,7 @@ ReadMultiXactCounts(uint32 *multixacts, MultiXactOffset *members)
26802679
* to a value just less than the number of multixacts in use. We hope that
26812680
* this will quickly trigger autovacuuming on the table or tables with the
26822681
* oldest relminmxid, thus allowing datminmxid values to advance and removing
2683-
* some members.
2682+
* some members.
26842683
*
26852684
* As the fraction of the member space currently in use grows, we become
26862685
* more aggressive in clamping this value. That not only causes autovacuum
@@ -2698,9 +2697,9 @@ int
26982697
MultiXactMemberFreezeThreshold(void)
26992698
{
27002699
MultiXactOffset members;
2701-
uint32 multixacts;
2702-
uint32 victim_multixacts;
2703-
double fraction;
2700+
uint32 multixacts;
2701+
uint32 victim_multixacts;
2702+
double fraction;
27042703

27052704
ReadMultiXactCounts(&multixacts, &members);
27062705

@@ -2725,32 +2724,32 @@ MultiXactMemberFreezeThreshold(void)
27252724

27262725
/*
27272726
* SlruScanDirectory callback.
2728-
* This callback deletes segments that are outside the range determined by
2729-
* the given page numbers.
2727+
* This callback deletes segments that are outside the range determined by
2728+
* the given page numbers.
27302729
*
27312730
* Both range endpoints are exclusive (that is, segments containing any of
27322731
* those pages are kept.)
27332732
*/
27342733
typedef struct MembersLiveRange
27352734
{
2736-
int rangeStart;
2737-
int rangeEnd;
2735+
int rangeStart;
2736+
int rangeEnd;
27382737
} MembersLiveRange;
27392738

27402739
static bool
27412740
SlruScanDirCbRemoveMembers(SlruCtl ctl, char *filename, int segpage,
27422741
void *data)
27432742
{
27442743
MembersLiveRange *range = (MembersLiveRange *) data;
2745-
MultiXactOffset nextOffset;
2744+
MultiXactOffset nextOffset;
27462745

27472746
if ((segpage == range->rangeStart) ||
27482747
(segpage == range->rangeEnd))
2749-
return false; /* easy case out */
2748+
return false; /* easy case out */
27502749

27512750
/*
2752-
* To ensure that no segment is spuriously removed, we must keep track
2753-
* of new segments added since the start of the directory scan; to do this,
2751+
* To ensure that no segment is spuriously removed, we must keep track of
2752+
* new segments added since the start of the directory scan; to do this,
27542753
* we update our end-of-range point as we run.
27552754
*
27562755
* As an optimization, we can skip looking at shared memory if we know for
@@ -2819,12 +2818,12 @@ SlruScanDirCbFindEarliest(SlruCtl ctl, char *filename, int segpage, void *data)
28192818
void
28202819
TruncateMultiXact(void)
28212820
{
2822-
MultiXactId oldestMXact;
2821+
MultiXactId oldestMXact;
28232822
MultiXactOffset oldestOffset;
2824-
MultiXactOffset nextOffset;
2823+
MultiXactOffset nextOffset;
28252824
mxtruncinfo trunc;
28262825
MultiXactId earliest;
2827-
MembersLiveRange range;
2826+
MembersLiveRange range;
28282827

28292828
Assert(AmCheckpointerProcess() || AmStartupProcess() ||
28302829
!IsPostmasterEnvironment);
@@ -2879,7 +2878,6 @@ TruncateMultiXact(void)
28792878
SimpleLruTruncate(MultiXactOffsetCtl,
28802879
MultiXactIdToOffsetPage(oldestMXact));
28812880

2882-
28832881
/*
28842882
* Now, and only now, we can advance the stop point for multixact members.
28852883
* If we did it any sooner, the segments we deleted above might already

0 commit comments

Comments
 (0)