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

Unexpected high file open ops #6345

Closed
JaySon-Huang opened this issue Nov 22, 2022 · 4 comments · Fixed by #6353
Closed

Unexpected high file open ops #6345

JaySon-Huang opened this issue Nov 22, 2022 · 4 comments · Fixed by #6353
Assignees

Comments

@JaySon-Huang
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

We get an unexpected high file open ops after running for a period
image

BlobStore::getBlobFile likely go into the miss branch
image

After restarted, the file open ops become normal
image

BlobStore::getBlobFile go into the hit branch
image

4. What is your TiFlash version? (Required)

v6.4.0

@JaySon-Huang JaySon-Huang added the type/bug The issue is confirmed as a bug. label Nov 22, 2022
@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Nov 22, 2022

Track in another issue 6347 Another problem is the cpu and memory reported by tiflash-proxy is abnormal ![image](https://user-images.githubusercontent.com/4865550/203213617-104f649b-8015-4db2-9fb2-63523ef58277.png)

@JaySon-Huang
Copy link
Contributor Author

@JaySon-Huang
Copy link
Contributor Author

image

@JaySon-Huang JaySon-Huang self-assigned this Nov 22, 2022
@JaySon-Huang
Copy link
Contributor Author

JaySon-Huang commented Nov 22, 2022

The root cause is LRUCache::remove does not update current_size. So that after lots of getOrSet and remove, removeOverflow will make the LRUCache only keep 1 element.

void remove(const Key & key)
{
std::lock_guard cache_lock(mutex);
auto it = cells.find(key);
if (it == cells.end())
return;
Cell & cell = it->second;
queue.erase(cell.queue_iterator);
cells.erase(it);
}

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

Successfully merging a pull request may close this issue.

2 participants