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

Global sort add index should use fixed memory size #52328

Closed
tangenta opened this issue Apr 3, 2024 · 0 comments · Fixed by #52329
Closed

Global sort add index should use fixed memory size #52328

tangenta opened this issue Apr 3, 2024 · 0 comments · Fixed by #52329

Comments

@tangenta
Copy link
Contributor

tangenta commented Apr 3, 2024

Enhancement

Currently, we use available memory to determine writer memory size when read-index stage starts.

memTotal, err := memory.MemTotal()
if err != nil {
return 0, err
}
memUsed, err := memory.MemUsed()
if err != nil {
return 0, err
}
memAvailable := memTotal - memUsed

This value can be different under different workloads. As a result, we may encounter the error "merge sort multi parts exceed 10000", because we cannot make sure the following formula if memsize is unstable:

partsize * 10000 >= 4000 * memsize
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