Skip to content

[PBCKP-150] Reading buffer is flushed each time we verify the checksum. #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[PBCKP-150] review fixes #2
  • Loading branch information
Daniel Shelepanov committed May 11, 2022
commit 9b88a5a0c904020dc70dd866c1ed45a166f0502a
5 changes: 2 additions & 3 deletions src/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,6 @@ prepare_page(pgFile *file, XLogRecPtr prev_backup_start_lsn,
{
/* read the block */
int read_len = fio_pread(in, page, blknum * BLCKSZ);
/* avoid re-reading once buffered data, flushing on further attempts, see PBCKP-150 */
if(try_again < PAGE_READ_ATTEMPTS - 1)
fflush(in);

/* The block could have been truncated. It is fine. */
if (read_len == 0)
Expand Down Expand Up @@ -352,6 +349,8 @@ prepare_page(pgFile *file, XLogRecPtr prev_backup_start_lsn,
Assert(false);
}
}
/* avoid re-reading once buffered data, flushing on further attempts, see PBCKP-150 */
fflush(in);
}

/*
Expand Down