-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix(Dgraph): Throttle number of files to open while schema update #7480
Conversation
worker/mutation.go
Outdated
maxOpenFileLimit = 1024 | ||
} | ||
glog.Infof("Max open files limit: %d", maxOpenFileLimit) | ||
// Badger opens around 7 files for indexing per predicate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you calculate the number 7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR to address the error of "Too many open files" on empty database. I arrived at this number to account for the files, MANIFEST, LOCK, KEYREGISTRY, DISCARD, 00001.mem and 00001.vlog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wouldn't solve the problem. Please see my comment.
Motivation:
Currently, while doing GraphQL schema update, many files are opened simultaneously for the purpose of indexing predicates. This may create a problem and throw error, "Too many open files" if ulimit is not set properly.
This PR fixes this and puts a limit on the number of threads which create and open files.
Note that this is only meant to address this problem on an empty database. The error may still be thrown (with lower frequency) if the schema update is done on a large dataset.
Testing:
This change is