Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit158f581

Browse files
committed
Fix if/while thinko in read_stream.c edge case.
When we determine that a wanted block can't be combined with the currentpending read, it's time to start that read to get it out of the way. An"if" in that code path should have been a "while", because it might takemore than one go in case of partial reads. This was only broken forsmaller ranges, as the more common case of io_combine_limit-sized rangesis handled earlier in the code and knows how to loop, hiding the bug fora while.Discovered while testing large parallel sequential scans of partiallycached tables. The ramp-up-and-down block allocator for parallel scanscould hit the problem case and skip some blocks near the end that shouldhave been streamed.Defect in commitb5a9b18.Discussion:https://postgr.es/m/CA%2BhUKG%2Bh8Whpv0YsJqjMVkjYX%2B80fTVc6oi-V%2BzxJvykLpLHYQ%40mail.gmail.com
1 parentbeb012b commit158f581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/storage/aio/read_stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ read_stream_look_ahead(ReadStream *stream, bool suppress_advice)
363363
}
364364

365365
/* We have to start the pending read before we can build another. */
366-
if (stream->pending_read_nblocks>0)
366+
while (stream->pending_read_nblocks>0)
367367
{
368368
read_stream_start_pending_read(stream,suppress_advice);
369369
suppress_advice= false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp