mirror of
https://gitee.com/he3db/he3pg.git
synced 2024-12-03 12:47:34 +08:00
slave replay
Code Source From: Self Code Description: [Optional] Jira: #[Optional] 市场项目编号(名称):[Optional]
This commit is contained in:
parent
37ec5b24b4
commit
e24c4f6fc9
@ -396,7 +396,7 @@ CleanLogIndexMain(int argc, char *argv[])
|
|||||||
int hasData = 0;
|
int hasData = 0;
|
||||||
|
|
||||||
pushStandbyPrePoint = pushStandbyPoint;
|
pushStandbyPrePoint = pushStandbyPoint;
|
||||||
if (push_standby == true||EnableHotStandby == false) {
|
if (push_standby == true || EnableHotStandby == false) {
|
||||||
pushStandbyPoint = GetXLogPushToDisk();
|
pushStandbyPoint = GetXLogPushToDisk();
|
||||||
if (pushStandbyPrePoint < pushStandbyPoint) {
|
if (pushStandbyPrePoint < pushStandbyPoint) {
|
||||||
hasData++;
|
hasData++;
|
||||||
|
@ -5965,12 +5965,14 @@ ReadRecord(XLogReaderState *xlogreader, int emode,
|
|||||||
/* This is the first attempt to read this page. */
|
/* This is the first attempt to read this page. */
|
||||||
lastSourceFailed = false;
|
lastSourceFailed = false;
|
||||||
#ifndef PG_NOREPLAY
|
#ifndef PG_NOREPLAY
|
||||||
if (push_standby == true && PushPtr == InvalidXLogRecPtr)
|
if ((push_standby == true || EnableHotStandby == false) &&
|
||||||
|
xlogreader->streamStart == true &&
|
||||||
|
PushPtr == InvalidXLogRecPtr)
|
||||||
{
|
{
|
||||||
PushPtr = xlogreader->EndRecPtr;
|
PushPtr = xlogreader->EndRecPtr;
|
||||||
PrePushPtr = xlogreader->EndRecPtr;
|
PrePushPtr = xlogreader->EndRecPtr;
|
||||||
ApplyLsn = PrePushPtr;
|
ApplyLsn = PrePushPtr;
|
||||||
XLogCtl->pushToDisk = ApplyLsn;
|
//XLogCtl->pushToDisk = ApplyLsn;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -12125,6 +12127,8 @@ void xlog_redo(XLogReaderState *record)
|
|||||||
{
|
{
|
||||||
CheckPointPtr = record->currRecPtr;
|
CheckPointPtr = record->currRecPtr;
|
||||||
memcpy(&GlobalCheckPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
memcpy(&GlobalCheckPoint, XLogRecGetData(record), sizeof(CheckPoint));
|
||||||
|
// for recover checkpoint must be flush disk,so set GlobalCheckPoint.redo = CheckPointPtr is ok
|
||||||
|
GlobalCheckPoint.redo = CheckPointPtr;
|
||||||
GlobalState = DB_IN_ARCHIVE_RECOVERY;
|
GlobalState = DB_IN_ARCHIVE_RECOVERY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -722,7 +722,7 @@ restart:
|
|||||||
#ifndef PG_NOREPLAY
|
#ifndef PG_NOREPLAY
|
||||||
if (IsBootstrapProcessingMode() != true && InitdbSingle!=true) {
|
if (IsBootstrapProcessingMode() != true && InitdbSingle!=true) {
|
||||||
if (getpid() == startupPid) {
|
if (getpid() == startupPid) {
|
||||||
if (push_standby == true||EnableHotStandby == false) {
|
if (push_standby == true || EnableHotStandby == false) {
|
||||||
// Update shared-memory status
|
// Update shared-memory status
|
||||||
XLogRecPtr prevPushPoint = PrePushPtr;
|
XLogRecPtr prevPushPoint = PrePushPtr;
|
||||||
if (!XLogRecPtrIsInvalid(CheckPointPtr)) {
|
if (!XLogRecPtrIsInvalid(CheckPointPtr)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user