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: https://github.com/facebook/rocksdb/pull/12147
Test Plan: Existing CircleCI
Reviewed By: cbi42
Differential Revision:
D52173481
Pulled By: akankshamahajan15
fbshipit-source-id:
fb9183b24c191d287a1d715346467bee66190f98
delay = 0;
}
TEST_SYNC_POINT("DBImpl::DelayWrite:Start");
+ 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
--- /dev/null
+Fix a WRITE_STALL counter that was reporting wrong value in few cases.