Skip to content
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

feat: update disk cache in another thread to avoid blocking normal query process #1431

Merged
merged 2 commits into from
Jan 9, 2024

Conversation

jiacai2050
Copy link
Contributor

@jiacai2050 jiacai2050 commented Jan 8, 2024

Rationale

When there is a cache miss in disk cache, it will

  1. Fetch data from remote
  2. Insert data to cache, which will incur disk IO
  3. Return the data for query.

We can move the second step to another thread to avoid it blocking the normal query process.

Detailed Changes

  • Make write disk nonblocking
  • Block on test explicitly, otherwise it will throw errors below

Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.

Test Plan

CI

Copy link
Member

@ShiKaiWi ShiKaiWi left a comment

Choose a reason for hiding this comment

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

LGTM

@jiacai2050 jiacai2050 merged commit 6cbf8c4 into apache:dev Jan 9, 2024
6 checks passed
@jiacai2050 jiacai2050 deleted the feat-nonblocking-cache branch January 9, 2024 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants