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 @@ -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 @@ -180,6 +180,9 @@ InitProcGlobal(void)
180
180
*/
181
181
ProcGlobal -> freeProcs = NULL ;
182
182
ProcGlobal -> autovacFreeProcs = NULL ;
183
+ ProcGlobal -> startupProc = NULL ;
184
+ ProcGlobal -> startupProcPid = 0 ;
185
+ ProcGlobal -> startupBufferPinWaitBufId = -1 ;
183
186
184
187
ProcGlobal -> spins_per_delay = DEFAULT_SPINS_PER_DELAY ;
185
188
@@ -499,7 +502,6 @@ PublishStartupProcessInformation(void)
499
502
500
503
procglobal -> startupProc = MyProc ;
501
504
procglobal -> startupProcPid = MyProcPid ;
502
- procglobal -> startupBufferPinWaitBufId = 0 ;
503
505
504
506
SpinLockRelease (ProcStructLock );
505
507
}
@@ -526,14 +528,10 @@ SetStartupBufferPinWaitBufId(int bufid)
526
528
int
527
529
GetStartupBufferPinWaitBufId (void )
528
530
{
529
- int bufid ;
530
-
531
531
/* use volatile pointer to prevent code rearrangement */
532
532
volatile PROC_HDR * procglobal = ProcGlobal ;
533
533
534
- bufid = procglobal -> startupBufferPinWaitBufId ;
535
-
536
- return bufid ;
534
+ return procglobal -> startupBufferPinWaitBufId ;
537
535
}
538
536
539
537
/*
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ typedef struct PROC_HDR
159
159
/* The proc of the Startup process, since not in ProcArray */
160
160
PGPROC * startupProc ;
161
161
int startupProcPid ;
162
- /* Buffer id of the buffer that Startup process waits for pin on */
162
+ /* Buffer id of the buffer that Startup process waits for pin on, or -1 */
163
163
int startupBufferPinWaitBufId ;
164
164
} PROC_HDR ;
165
165
You can’t perform that action at this time.
0 commit comments