forked from hypermodeinc/badger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Non-locking, read-only opens (hypermodeinc#432)
* Read-only opens This introduces a read-only option on the DB struct. The main effect is to force all transactions to be read-only. It also skips anything that might write to disk. It will put a shared lock on the directory when it's opened read-only. This will allow other read-only opens but will deny read-write opens until all readers have closed. If the database is already open read-write and an attempt is made to open it again (read-only or read-write), an error occurs. It also: - Fails if the manifest doesn't exist on read-only open - Does not attempt to truncate the manifest - Skips compactors and memtable - All vlogs are opened read-only * Avoid truncating vlog in read-only mode There shouldn't be any need anyways. * ReadOnly opens fail on corrupt DB If there is data in a vlog to be replayed, opening the DB with ReadOnly set will return an error. * Unplumb the readonly args The vlog structure already carries the opts from it's Open() * Use flags instead of bools for OpenExistingSyncedFile * Comment changes per @manishrjain * OpenExistingSyncFile -> OpenExistingFile To reflect that it's not just for synced files. * Add a placeholder for Windows read-only mode * Hack tests to pass through Windows failures These tests are useless on Windows until the placeholder in dir_windows.go is removed. * Changes requested by @manishrjain Arg cleanups + house preferences.
- Loading branch information
1 parent
e8ce3e9
commit dc0df25
Showing
13 changed files
with
248 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.