fix existing overlap when pushtandby parallel read wals

Signed-off-by: shipixian <shipixian_yewu@cmss.chinamobile.com>
This commit is contained in:
shipixian 2023-03-29 20:29:10 +08:00
parent fbd917a716
commit 0d4f1d9fce
2 changed files with 7 additions and 3 deletions

View File

@ -14328,7 +14328,7 @@ retry:
if (EnableHotStandby && !push_standby)
walStoreToLocal = true;
r = batchRead((uint8_t *) readBuf, ControlFile->checkPointCopy.ThisTimeLineID, targetOff,targetOff+8192,walStoreToLocal);
r = batchRead((uint8_t *) readBuf, ControlFile->checkPointCopy.ThisTimeLineID, targetOff,targetOff+16384,walStoreToLocal);
pgstat_report_wait_end();
/*
@ -14483,7 +14483,11 @@ producerXLogParallelBatchRead(XLogReaderState *xlogreader, XLogRecPtr startPtr,
for(;start < end;start += tlen) {
wal_batch_t walElem;
walElem.startLsn = start;
walElem.endLsn = start + tlen;
// walElem.endLsn = start + tlen;
if (start + tlen <= end)
walElem.endLsn = start + tlen;
else
walElem.endLsn = end;
wal_batch_t *curElem = NULL;
while((curElem = ring_buffer_queue(gRingBufferManger,walElem)) == NULL) {
usleep(10);

View File

@ -1431,7 +1431,7 @@ He3DBWALRead(XLogReaderState *state,
pgstat_report_wait_start(WAIT_EVENT_WAL_READ);
#endif
nbytes = batchRead((uint8_t *) buf, state->currTLI, startptr, false);
nbytes = batchRead((uint8_t *) buf, state->currTLI, startptr, startptr+16384, false);
#ifndef FRONTEND
pgstat_report_wait_end();