-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Avoid overwriting non-okay status due to shutdown or manual compaction pause #13891
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
a1ef82f
to
4b9507e
Compare
4b9507e
to
3fd995a
Compare
3fd995a
to
a9a5676
Compare
db/compaction/compaction_iterator.cc
Outdated
@@ -1120,16 +1120,16 @@ void CompactionIterator::NextFromInput() { | |||
} | |||
} | |||
|
|||
if (!Valid() && IsShuttingDown()) { | |||
if (!Valid() && status_.ok() && IsShuttingDown()) { |
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.
nit: wondering if we can place all three checks under the same status_.ok check and use else if
if (status_.ok()) {
if (!Valid() && IsShuttingDown()) {
status_ = Status::ShutdownInProgress();
} else if (IsPausingManualCompaction()) {
status_ = Status::Incomplete(Status::SubCode::kManualCompactionPaused);
} else if (!input_.Valid() && input_.status().IsCorruption()) {
status_ = input_.status();
}
}
to avoid two additional status_.ok()
checks.
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.
Fixed
@@ -1610,11 +1610,10 @@ Status CompactionJob::FinalizeProcessKeyValueStatus( | |||
status = | |||
Status::ColumnFamilyDropped("Column family dropped during compaction"); | |||
} | |||
if ((status.ok() || status.IsColumnFamilyDropped()) && | |||
shutting_down_->load(std::memory_order_relaxed)) { | |||
if (status.ok() && shutting_down_->load(std::memory_order_relaxed)) { |
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.
Curious why we were overwriting ColumnFamilyDropped()
status with IsShutdown or IsPaused status previously.
As opposed to the change above in NextFromInput()
, this checks were explicitly checking IsColumnFamilyDropped()
, so I'm wondering if there was a reason 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.
Probably just an honest inconsistency.
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.
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.
Thanks!
Context/Summary:
A small change as titled.
Test plan: