fix: mini consistent point problem

This commit is contained in:
wangyao 2023-06-26 07:26:31 +00:00 committed by Gitee
commit 7e609e9938
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 12 additions and 16 deletions

View File

@ -7993,30 +7993,24 @@ void pushTikv(int onePageListLen,int pageNum,bool flag)
SortPageQueue();
//wait shared queue data handler
while(pageNum > CompletedTaskNum()) {
usleep(10);
pg_usleep(1000L);
}
cleanMap();
start = end;
PushPtr = GetXLogReplayRecPtr(NULL);
PrePushPtr = PushPtr;
if (ApplyLsn < PushPtr) {
ApplyLsn = PushPtr;
if (push_standby == true && XLogCtl->pushToDisk != PushPtr && !mpush) {
InsertConsistToKV(PushPtr);
}
if (push_standby == true && XLogCtl->pushToDisk != ApplyLsn && !mpush) {
InsertConsistToKV(ApplyLsn);
}
XLogCtl->pushToDisk = ApplyLsn;
XLogCtl->pushToDisk = PushPtr;
} else {
if (flag == true) {
PushPtr = GetXLogReplayRecPtr(NULL);
PrePushPtr = PushPtr;
if (ApplyLsn < PushPtr) {
ApplyLsn = PushPtr;
if (push_standby == true && XLogCtl->pushToDisk != PushPtr && !mpush) {
InsertConsistToKV(PushPtr);
}
if (push_standby == true && XLogCtl->pushToDisk != ApplyLsn && !mpush) {
InsertConsistToKV(ApplyLsn);
}
XLogCtl->pushToDisk = ApplyLsn;
XLogCtl->pushToDisk = PushPtr;
}
}

View File

@ -764,13 +764,14 @@ restart:
}
//need to tell push standby has new standby add
while(ApplyLsn != InvalidXLogRecPtr && RecPtr >= ApplyLsn) {
XLogRecPtr tmpLsn = InvalidXLogRecPtr;
XLogRecPtr tmpLsn = InvalidXLogRecPtr;
if (!he3mirror) {
tmpLsn = QueryMinLsn(InvalidXLogRecPtr);
}
if (tmpLsn !=InvalidXLogRecPtr) {
pushTikv(0,hashMapSize(),true);
if (tmpLsn <= RecPtr) {
pg_usleep(200000);
pg_usleep(10000);
continue;
} else {
ApplyLsn = tmpLsn;
@ -1126,11 +1127,12 @@ restart:
}
//need to tell push standby has new standby add
while(ApplyLsn != InvalidXLogRecPtr && RecPtr >= ApplyLsn) {
XLogRecPtr tmpLsn = InvalidXLogRecPtr;
XLogRecPtr tmpLsn = InvalidXLogRecPtr;
if (!he3mirror) {
tmpLsn = QueryMinLsn(InvalidXLogRecPtr);
}
if (tmpLsn !=InvalidXLogRecPtr) {
pushTikv(0,hashMapSize(),true);
if (tmpLsn <= RecPtr) {
pg_usleep(10000);
continue;