File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -2422,10 +2422,11 @@ LockBufferForCleanup(Buffer buffer)
2422
2422
/* Wait to be signaled by UnpinBuffer() */
2423
2423
if (InHotStandby )
2424
2424
{
2425
- /* Share the bufid that Startup process waits on */
2425
+ /* Publish the bufid that Startup process waits on */
2426
2426
SetStartupBufferPinWaitBufId (buffer - 1 );
2427
2427
/* Set alarm and then wait to be signaled by UnpinBuffer() */
2428
2428
ResolveRecoveryConflictWithBufferPin ();
2429
+ /* Reset the published bufid */
2429
2430
SetStartupBufferPinWaitBufId (-1 );
2430
2431
}
2431
2432
else
Original file line number Diff line number Diff line change @@ -179,6 +179,9 @@ InitProcGlobal(void)
179
179
*/
180
180
ProcGlobal -> freeProcs = NULL ;
181
181
ProcGlobal -> autovacFreeProcs = NULL ;
182
+ ProcGlobal -> startupProc = NULL ;
183
+ ProcGlobal -> startupProcPid = 0 ;
184
+ ProcGlobal -> startupBufferPinWaitBufId = -1 ;
182
185
183
186
ProcGlobal -> spins_per_delay = DEFAULT_SPINS_PER_DELAY ;
184
187
@@ -487,7 +490,6 @@ PublishStartupProcessInformation(void)
487
490
488
491
procglobal -> startupProc = MyProc ;
489
492
procglobal -> startupProcPid = MyProcPid ;
490
- procglobal -> startupBufferPinWaitBufId = 0 ;
491
493
492
494
SpinLockRelease (ProcStructLock );
493
495
}
@@ -514,14 +516,10 @@ SetStartupBufferPinWaitBufId(int bufid)
514
516
int
515
517
GetStartupBufferPinWaitBufId (void )
516
518
{
517
- int bufid ;
518
-
519
519
/* use volatile pointer to prevent code rearrangement */
520
520
volatile PROC_HDR * procglobal = ProcGlobal ;
521
521
522
- bufid = procglobal -> startupBufferPinWaitBufId ;
523
-
524
- return bufid ;
522
+ return procglobal -> startupBufferPinWaitBufId ;
525
523
}
526
524
527
525
/*
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ typedef struct PROC_HDR
145
145
/* The proc of the Startup process, since not in ProcArray */
146
146
PGPROC * startupProc ;
147
147
int startupProcPid ;
148
- /* Buffer id of the buffer that Startup process waits for pin on */
148
+ /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
149
149
int startupBufferPinWaitBufId ;
150
150
} PROC_HDR ;
151
151
You can’t perform that action at this time.
0 commit comments