Skip to content

Commit

Permalink
fix FragmentBufferedReader (for secondary instance)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkr committed May 15, 2024
1 parent 8db9199 commit c24bf97
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions db/log_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,12 @@ bool FragmentBufferedReader::TryReadFragment(
int header_size = kHeaderSize;
if ((type >= kRecyclableFullType && type <= kRecyclableLastType) ||
type == kRecyclableUserDefinedTimestampSizeType) {
if (end_of_buffer_offset_ - buffer_.size() == 0) {
recycled_ = true;
if (first_record_read_ && !recycled_) {
// A recycled log should have started with a recycled record
*fragment_type_or_err = kBadRecord;
return true;
}
recycled_ = true;
header_size = kRecyclableHeaderSize;
while (buffer_.size() < static_cast<size_t>(kRecyclableHeaderSize)) {
size_t old_size = buffer_.size();
Expand Down

0 comments on commit c24bf97

Please sign in to comment.