-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove vlog file if bootstrap, syncDir or mmap fails #1434
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
Conversation
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error.
| @@ -1000,14 +1000,26 @@ func (vlog *valueLog) createVlogFile(fid uint32) (*logFile, error) { | |||
| return nil, errFile(err, lf.path, "Create value log file") | |||
| } | |||
|
|
|||
| removeFile := func() { | |||
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.
Add test for this.
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.
I tried to add a test by setting ulimit but this will be difficult for two reasons
ulimitis set per process. If I set theulimitfor a test, it might affect other tests too.- It's hard to set the correct
ulimitand the test wouldn't fail even if the limit is off by 1.
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.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ashish-goswami and @manishrjain)
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.
Looks good!!
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930
…) (hypermodeinc#1515) The createVlogFile function creates a new vlog file. The function apart from creating a new file, bootstraps it, syncs it to the disk, and mmaps it. If any of the three operations fail, we will end up with a file on the disk but the vlog.maxFid will not be updated. On the next attempt to create the vlog files, we will get a "File already exists" error. This commit fixes this issue by removing the file if createVlogFile encounters any error. Fixes DGRAPH-1930 (cherry picked from commit dfcca75)
The
createVlogFilefunction creates a new vlog file. The function apartfrom creating a new file, bootstraps it, syncs it to the disk, and mmaps it.
If any of the three operations fail, we will end up with a file on the
disk but the vlog.maxFid will not be updated.
On the next attempt to create the vlog files, we will get a "File
already exists" error. This commit fixes this issue by removing the file
if
createVlogFileencounters any error.Fixes DGRAPH-1930
This change is