]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Fix WRITE_STALL start_time (#12147)
authorAkanksha Mahajan <43301668+akankshamahajan15@users.noreply.github.com>
Thu, 14 Dec 2023 21:45:06 +0000 (13:45 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Thu, 14 Dec 2023 21:45:06 +0000 (13:45 -0800)
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

db/db_impl/db_impl_write.cc
unreleased_history/bug_fixes/fix_stall_counter.md [new file with mode: 0644]

index 8add1e990b742ad541c9cb4a6c7d2a44ba658244..df67ba8c8f1632f2bcb4996a543c806da2774a2c 100644 (file)
@@ -1839,11 +1839,12 @@ Status DBImpl::DelayWrite(uint64_t num_bytes, WriteThread& write_thread,
       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
diff --git a/unreleased_history/bug_fixes/fix_stall_counter.md b/unreleased_history/bug_fixes/fix_stall_counter.md
new file mode 100644 (file)
index 0000000..be9e512
--- /dev/null
@@ -0,0 +1 @@
+Fix a WRITE_STALL counter that was reporting wrong value in few cases.