Merge pull request #35771 from bigo-sg/fix-filebuffer-pos

fix filebuffer pos in RemoteReadBuffer
This commit is contained in:
Kseniia Sumarokova 2022-04-06 11:57:05 +02:00 committed by GitHub
commit bb26903675
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,8 @@ bool RemoteReadBuffer::nextImpl()
return status;
}
//file_buffer::pos should increase correspondingly when RemoteReadBuffer is consumed, otherwise start_offset will be incorrect.
local_file_holder->file_buffer->position() = local_file_holder->file_buffer->buffer().begin() + BufferBase::offset();
auto start_offset = local_file_holder->file_buffer->getPosition();
auto end_offset = start_offset + local_file_holder->file_buffer->internalBuffer().size();
local_file_holder->file_cache_controller->value().waitMoreData(start_offset, end_offset);