-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Auto recovery from out of space errors #4164
Closed
Closed
Changes from 16 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
29f30b9
Auto recovery from out of space errors
e0be66f
Fix bugs found by additional testing
0222a47
Fix build failures
d3a3c49
Fix more Travis errors
681d78a
Fix ROCKSDB_LITE build
709b6b9
Debug Travis CI failures
24002c6
Reenable builds in Travis CI to debug a coredump
a685441
Reenable all builds in Travis CI and keep gdb/coredump
30548bc
Debug Travis CI failure: Only enable coredump for TEST_GROUP 1
d2185a2
Fix syntax error in .travis.yml
8653dc1
Revert all changes in .travis.yml
39a473f
2nd attempt at printing stack trace in Travis build
3daaca9
Don't install gdb for osx builds
ebdc71b
More tests, a bug fix and some clean-up/comments
feea658
Address code review comments
a59b8b2
Rebase to latest master after resolving conflicts
359d98a
Address final few code review comments
832fa03
Fix a race between recovery completion and DB shutdown
7989ce6
Fix one more race of shutdown initiated before recovery attempt
dbef9f0
Enable gdb in travis
893bcc6
2nd attempt at Travis gdb
98cafaa
3rd attempt at Travis
cdaae4e
Revert .travis.yml and fix some mem leaks in error_handler_test
6e278e1
Disable tests failing only in Travis
d4760ff
Disable a few more tests in Travis
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -795,6 +795,7 @@ class DBImpl : public DB { | |
|
||
private: | ||
friend class DB; | ||
friend class ErrorHandler; | ||
friend class InternalStats; | ||
friend class PessimisticTransaction; | ||
friend class TransactionBaseImpl; | ||
|
@@ -845,6 +846,8 @@ class DBImpl : public DB { | |
bool read_only = false, bool error_if_log_file_exist = false, | ||
bool error_if_data_exists_in_logs = false); | ||
|
||
Status ResumeImpl(); | ||
|
||
void MaybeIgnoreError(Status* s) const; | ||
|
||
const Status CreateArchivalDirectory(); | ||
|
@@ -1042,9 +1045,10 @@ class DBImpl : public DB { | |
LogBuffer* log_buffer, | ||
PrepickedCompaction* prepicked_compaction); | ||
Status BackgroundFlush(bool* madeProgress, JobContext* job_context, | ||
LogBuffer* log_buffer); | ||
LogBuffer* log_buffer, FlushReason* reason); | ||
|
||
bool EnoughRoomForCompaction(const std::vector<CompactionInputFiles>& inputs, | ||
bool EnoughRoomForCompaction(ColumnFamilyData* cfd, | ||
const std::vector<CompactionInputFiles>& inputs, | ||
bool* sfm_bookkeeping, LogBuffer* log_buffer); | ||
|
||
void PrintStatistics(); | ||
|
@@ -1078,6 +1082,10 @@ class DBImpl : public DB { | |
|
||
Status CloseHelper(); | ||
|
||
Status FlushAllCFs(FlushReason flush_reason); | ||
|
||
void WaitForBackgroundWork(); | ||
|
||
// table_cache_ provides its own synchronization | ||
std::shared_ptr<Cache> table_cache_; | ||
|
||
|
@@ -1534,6 +1542,14 @@ class DBImpl : public DB { | |
bool closed_; | ||
|
||
ErrorHandler error_handler_; | ||
|
||
// Flag to indicate that the DB instance shutdown has been initiated. This | ||
// different from shutting_down_ atomic in that it is set at the beginning | ||
// of shutdown sequence, specifically in order to prevent any background | ||
// error recovery from going on in parallel. The latter, shutting_down_, | ||
// is set a little later during the shutdown after scheduling memtable | ||
// flushes | ||
bool shutdown_flag_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe call it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe I'm picky but if possible can we place it together with those bool variables, for better padding? |
||
}; | ||
|
||
extern Options SanitizeOptions(const std::string& db, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you write a comment describing what the function is doing?