Skip to content

Fix threadpool read for remote disks#31112

Merged
kssenii merged 3 commits intoClickHouse:masterfrom
kssenii:fix-async-reads
Nov 8, 2021
Merged

Fix threadpool read for remote disks#31112
kssenii merged 3 commits intoClickHouse:masterfrom
kssenii:fix-async-reads

Conversation

@kssenii
Copy link
Copy Markdown
Member

@kssenii kssenii commented Nov 5, 2021

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

@robot-clickhouse robot-clickhouse added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 5, 2021
@alesapin alesapin self-assigned this Nov 8, 2021
auto [right_offset, mark_range_bytes] = getRightOffsetAndBytesRange(range.begin, range.end);
if (!right_offset)
{
if (last_right_offset && !last_right_offset.value())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely confusing. list_right_offset && list_right_offset == 0 right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need it? What happen if we just remove this if?

Copy link
Copy Markdown
Member Author

@kssenii kssenii Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we need it. Otherwise this will happen:

DB::Exception: Received from localhost:9000. DB::Exception: Prefetch is valid in readUntilEnd

Extremely confusing. list_right_offset && list_right_offset == 0 right?

Yes.


void setReadUntilPosition(size_t position) override { impl->setReadUntilPosition(position); }

void setReadUntilEnd() override { impl->setReadUntilEnd(); }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main fix here?

Copy link
Copy Markdown
Member Author

@kssenii kssenii Nov 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, 50/50 with other code. There were two different exceptions.

if (last_right_offset && !last_right_offset.value())
return;

last_right_offset = 0; // Zero value means the end of file.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason as I wrote on your first comment.

@kssenii
Copy link
Copy Markdown
Member Author

kssenii commented Nov 8, 2021

Integration tests failures not related to changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants