@@ -542,18 +542,6 @@ typedef union WALInsertLockPadded
542
542
char pad [PG_CACHE_LINE_SIZE ];
543
543
} WALInsertLockPadded ;
544
544
545
-
546
- /*
547
- * NEON: check if primary node is running.
548
- * Correspondent GUC is received from control plane
549
- */
550
- static bool
551
- IsPrimaryAlive ()
552
- {
553
- const char * val = GetConfigOption ("neon.primary_is_running" , true, false);
554
- return val != NULL && strcmp (val , "on" ) == 0 ;
555
- }
556
-
557
545
/*
558
546
* State of an exclusive backup, necessary to control concurrent activities
559
547
* across sessions when working on exclusive backups.
@@ -7038,25 +7026,7 @@ StartupXLOG(void)
7038
7026
EndRecPtr = ControlFile -> checkPointCopy .redo ;
7039
7027
7040
7028
memcpy (& checkPoint , & ControlFile -> checkPointCopy , sizeof (CheckPoint ));
7041
- // When primary Neon compute node is started, we pretend that it started after a clean shutdown and
7042
- // no recovery is needed. We don't need to do WAL replay, the page server does that on a page-by-page basis.
7043
- // When a read-only replica is started, PostgreSQL normally waits for a shutdown checkpoint or running-xacts
7044
- // record before enabling hot standby, to establish which transactions are still running in the primary,
7045
- // and might still commit later. But if we know that the primary is not running - because the control plane
7046
- // says so - we can skip that. That avoids having to wait indefinitely if the primary is not running. This is
7047
- // particularly important for Neon because we don't start recovery from a checkpoint record, so there's
7048
- // no guarantee on when we'll see the next checkpoint or running-xacts record, if ever. so if we know the primary is
7049
- // not currently running, also set wasShutdown to 'true'.
7050
- if (StandbyModeRequested &&
7051
- PrimaryConnInfo != NULL && * PrimaryConnInfo != '\0' )
7052
- {
7053
- if (!IsPrimaryAlive ())
7054
- wasShutdown = true;
7055
- else
7056
- wasShutdown = false;
7057
- }
7058
- else
7059
- wasShutdown = true;
7029
+ wasShutdown = true;
7060
7030
7061
7031
/* Initialize expectedTLEs, like ReadRecord() does */
7062
7032
expectedTLEs = readTimeLineHistory (checkPoint .ThisTimeLineID );
@@ -7226,24 +7196,6 @@ StartupXLOG(void)
7226
7196
ereport (PANIC ,
7227
7197
(errmsg ("invalid next transaction ID" )));
7228
7198
7229
- if (ZenithRecoveryRequested )
7230
- {
7231
- if (wasShutdown )
7232
- checkPoint .oldestActiveXid = InvalidTransactionId ;
7233
- else if (!TransactionIdIsValid (checkPoint .oldestActiveXid ))
7234
- {
7235
- /*
7236
- * Pageserver extracts oldestActiveXid from snapshot and running xacts WAL records
7237
- * and include it in checkpoint sent in basebackup.
7238
- * So oldestActiveXid can be zero only after database initialization when no checkpoints are yet performed
7239
- * and not running xacts records was logged.
7240
- * In this case it is possible to use FirstNormalTransactionId as safe conservative estimation
7241
- * of oldest active transaction XID.
7242
- */
7243
- checkPoint .oldestActiveXid = FirstNormalTransactionId ;
7244
- }
7245
- }
7246
-
7247
7199
/* initialize shared memory variables from the checkpoint record */
7248
7200
ShmemVariableCache -> nextXid = checkPoint .nextXid ;
7249
7201
ShmemVariableCache -> nextOid = checkPoint .nextOid ;
0 commit comments