Skip to content

Commit cd577f6

Browse files
Fix WRITE_STALL start_time (#12147)
Summary: `Delayed` is set true in two cases. One is when `delay` is specified. Other one is in the `while` loop - https://github.com/facebook/rocksdb/blob/cd21e4e69d76ec4ec3b080c8cdae016ac2309cc5/db/db_impl/db_impl_write.cc#L1876 However start_time is not initialized in second case, resulting in time_delayed = immutable_db_options_.clock->NowMicros() - 0(start_time); Pull Request resolved: #12147 Test Plan: Existing CircleCI Reviewed By: cbi42 Differential Revision: D52173481 Pulled By: akankshamahajan15 fbshipit-source-id: fb9183b24c191d287a1d715346467bee66190f98
1 parent 5502f06 commit cd577f6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

db/db_impl/db_impl_write.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,11 +1839,12 @@ Status DBImpl::DelayWrite(uint64_t num_bytes, WriteThread& write_thread,
18391839
delay = 0;
18401840
}
18411841
TEST_SYNC_POINT("DBImpl::DelayWrite:Start");
1842+
start_time = immutable_db_options_.clock->NowMicros();
1843+
18421844
if (delay > 0) {
18431845
if (write_options.no_slowdown) {
18441846
return Status::Incomplete("Write stall");
18451847
}
1846-
start_time = immutable_db_options_.clock->NowMicros();
18471848
TEST_SYNC_POINT("DBImpl::DelayWrite:Sleep");
18481849

18491850
// Notify write_thread about the stall so it can setup a barrier and
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix a WRITE_STALL counter that was reporting wrong value in few cases.

0 commit comments

Comments
 (0)