Skip to content

Commit

Permalink
Fix Stall start_time
Browse files Browse the repository at this point in the history
Summary:

Test Plan:

Reviewers:

Subscribers:

Tasks:

Tags:
  • Loading branch information
akankshamahajan15 committed Dec 14, 2023
1 parent cd21e4e commit 83570d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions db/db_impl/db_impl_write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,6 @@ uint64_t DBImpl::GetMaxTotalWalSize() const {
Status DBImpl::DelayWrite(uint64_t num_bytes, WriteThread& write_thread,
const WriteOptions& write_options) {
mutex_.AssertHeld();
uint64_t start_time = 0;
bool delayed = false;
{
// To avoid parallel timed delays (bad throttling), only support them
Expand All @@ -1839,11 +1838,12 @@ Status DBImpl::DelayWrite(uint64_t num_bytes, WriteThread& write_thread,
delay = 0;
}
TEST_SYNC_POINT("DBImpl::DelayWrite:Start");
uint64_t start_time = immutable_db_options_.clock->NowMicros();

if (delay > 0) {
if (write_options.no_slowdown) {
return Status::Incomplete("Write stall");
}
start_time = immutable_db_options_.clock->NowMicros();
TEST_SYNC_POINT("DBImpl::DelayWrite:Sleep");

// Notify write_thread about the stall so it can setup a barrier and
Expand Down

0 comments on commit 83570d3

Please sign in to comment.