mirror of
https://gitee.com/he3db/he3pg.git
synced 2024-12-02 04:07:34 +08:00
maxIdx wal query
Code Source From: Self Code Description: 【Optional】 Jira: #【Optional】 市场项目编号(名称):【Optional】
This commit is contained in:
parent
cb3bc1eb79
commit
b720e4664d
@ -130,10 +130,10 @@ int walRecordQuery(char**buffer,int* curpos,int* maxspace,uint64 lsn) {
|
||||
ring_buffer_size_t tailIdx = gRingBufferManger->tail_index;
|
||||
int low = tailIdx,high = ((tailIdx+maxIdx) & RING_BUFFER_MASK(buffer)), mid = 0;
|
||||
if (low > high) {
|
||||
if (gRingBufferManger->buffer[0].startLsn!=0 && gRingBufferManger->buffer[0].startLsn <= lsn) {
|
||||
low = 0;
|
||||
} else {
|
||||
if (gRingBufferManger->buffer[gRingBufferManger->buffer_mask].startLsn + gRingBufferManger->buffer[gRingBufferManger->buffer_mask].dataLen > lsn) {
|
||||
high = gRingBufferManger->buffer_mask+1;
|
||||
} else {
|
||||
low = 0;
|
||||
}
|
||||
}
|
||||
if (gRingBufferManger->buffer[high-1].startLsn == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user