File tree 3 files changed +7
-8
lines changed
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2449,10 +2449,11 @@ LockBufferForCleanup(Buffer buffer)
2449
2449
/* Wait to be signaled by UnpinBuffer() */
2450
2450
if (InHotStandby )
2451
2451
{
2452
- /* Share the bufid that Startup process waits on */
2452
+ /* Publish the bufid that Startup process waits on */
2453
2453
SetStartupBufferPinWaitBufId (buffer - 1 );
2454
2454
/* Set alarm and then wait to be signaled by UnpinBuffer() */
2455
2455
ResolveRecoveryConflictWithBufferPin ();
2456
+ /* Reset the published bufid */
2456
2457
SetStartupBufferPinWaitBufId (-1 );
2457
2458
}
2458
2459
else
Original file line number Diff line number Diff line change @@ -171,6 +171,9 @@ InitProcGlobal(void)
171
171
ProcGlobal -> spins_per_delay = DEFAULT_SPINS_PER_DELAY ;
172
172
ProcGlobal -> freeProcs = NULL ;
173
173
ProcGlobal -> autovacFreeProcs = NULL ;
174
+ ProcGlobal -> startupProc = NULL ;
175
+ ProcGlobal -> startupProcPid = 0 ;
176
+ ProcGlobal -> startupBufferPinWaitBufId = -1 ;
174
177
175
178
/*
176
179
* Create and initialize all the PGPROC structures we'll need (except for
@@ -493,7 +496,6 @@ PublishStartupProcessInformation(void)
493
496
494
497
procglobal -> startupProc = MyProc ;
495
498
procglobal -> startupProcPid = MyProcPid ;
496
- procglobal -> startupBufferPinWaitBufId = 0 ;
497
499
498
500
SpinLockRelease (ProcStructLock );
499
501
}
@@ -520,14 +522,10 @@ SetStartupBufferPinWaitBufId(int bufid)
520
522
int
521
523
GetStartupBufferPinWaitBufId (void )
522
524
{
523
- int bufid ;
524
-
525
525
/* use volatile pointer to prevent code rearrangement */
526
526
volatile PROC_HDR * procglobal = ProcGlobal ;
527
527
528
- bufid = procglobal -> startupBufferPinWaitBufId ;
529
-
530
- return bufid ;
528
+ return procglobal -> startupBufferPinWaitBufId ;
531
529
}
532
530
533
531
/*
Original file line number Diff line number Diff line change @@ -178,7 +178,7 @@ typedef struct PROC_HDR
178
178
/* The proc of the Startup process, since not in ProcArray */
179
179
PGPROC * startupProc ;
180
180
int startupProcPid ;
181
- /* Buffer id of the buffer that Startup process waits for pin on */
181
+ /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
182
182
int startupBufferPinWaitBufId ;
183
183
} PROC_HDR ;
184
184
You can’t perform that action at this time.
0 commit comments