diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index a1d9675..a88037b 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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); diff --git a/src/backend/access/transam/xlogreader.c b/src/backend/access/transam/xlogreader.c index 46259ff..83751c1 100644 --- a/src/backend/access/transam/xlogreader.c +++ b/src/backend/access/transam/xlogreader.c @@ -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();