@ -903,8 +903,9 @@ XLogInsertRecord(XLogRecData *rdata, XLogRecPtr fpw_lsn)
pg_crc32c rdata_crc ;
pg_crc32c rdata_crc ;
bool inserted ;
bool inserted ;
XLogRecord * rechdr = ( XLogRecord * ) rdata - > data ;
XLogRecord * rechdr = ( XLogRecord * ) rdata - > data ;
uint8 info = rechdr - > xl_info & ~ XLR_INFO_MASK ;
bool isLogSwitch = ( rechdr - > xl_rmid = = RM_XLOG_ID & &
bool isLogSwitch = ( rechdr - > xl_rmid = = RM_XLOG_ID & &
rechdr - > xl_ info = = XLOG_SWITCH ) ;
info = = XLOG_SWITCH ) ;
XLogRecPtr StartPos ;
XLogRecPtr StartPos ;
XLogRecPtr EndPos ;
XLogRecPtr EndPos ;
@ -6170,7 +6171,7 @@ StartupXLOG(void)
if ( record ! = NULL )
if ( record ! = NULL )
{
{
memcpy ( & checkPoint , XLogRecGetData ( xlogreader ) , sizeof ( CheckPoint ) ) ;
memcpy ( & checkPoint , XLogRecGetData ( xlogreader ) , sizeof ( CheckPoint ) ) ;
wasShutdown = ( record - > xl_info = = XLOG_CHECKPOINT_SHUTDOWN ) ;
wasShutdown = ( ( record - > xl_info & ~ XLR_INFO_MASK ) = = XLOG_CHECKPOINT_SHUTDOWN ) ;
ereport ( DEBUG1 ,
ereport ( DEBUG1 ,
( errmsg ( " checkpoint record is at %X/%X " ,
( errmsg ( " checkpoint record is at %X/%X " ,
( uint32 ) ( checkPointLoc > > 32 ) , ( uint32 ) checkPointLoc ) ) ) ;
( uint32 ) ( checkPointLoc > > 32 ) , ( uint32 ) checkPointLoc ) ) ) ;
@ -6328,7 +6329,7 @@ StartupXLOG(void)
( errmsg ( " could not locate a valid checkpoint record " ) ) ) ;
( errmsg ( " could not locate a valid checkpoint record " ) ) ) ;
}
}
memcpy ( & checkPoint , XLogRecGetData ( xlogreader ) , sizeof ( CheckPoint ) ) ;
memcpy ( & checkPoint , XLogRecGetData ( xlogreader ) , sizeof ( CheckPoint ) ) ;
wasShutdown = ( record - > xl_info = = XLOG_CHECKPOINT_SHUTDOWN ) ;
wasShutdown = ( ( record - > xl_info & ~ XLR_INFO_MASK ) = = XLOG_CHECKPOINT_SHUTDOWN ) ;
}
}
/*
/*
@ -7785,6 +7786,7 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
int whichChkpt , bool report )
int whichChkpt , bool report )
{
{
XLogRecord * record ;
XLogRecord * record ;
uint8 info ;
if ( ! XRecOffIsValid ( RecPtr ) )
if ( ! XRecOffIsValid ( RecPtr ) )
{
{
@ -7810,6 +7812,7 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
}
}
record = ReadRecord ( xlogreader , RecPtr , LOG , true ) ;
record = ReadRecord ( xlogreader , RecPtr , LOG , true ) ;
info = record - > xl_info & ~ XLR_INFO_MASK ;
if ( record = = NULL )
if ( record = = NULL )
{
{
@ -7852,8 +7855,8 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
}
}
return NULL ;
return NULL ;
}
}
if ( record - > xl_ info ! = XLOG_CHECKPOINT_SHUTDOWN & &
if ( info ! = XLOG_CHECKPOINT_SHUTDOWN & &
record - > xl_ info ! = XLOG_CHECKPOINT_ONLINE )
info ! = XLOG_CHECKPOINT_ONLINE )
{
{
switch ( whichChkpt )
switch ( whichChkpt )
{
{