]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: concurrency adjustment - consider the case caller provides 1 68659/head
authorOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 29 Apr 2026 21:36:48 +0000 (21:36 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 29 Apr 2026 21:36:48 +0000 (21:36 +0000)
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
src/rgw/driver/rados/rgw_data_sync.h

index d26532f9971cf43877baf5e46d4801475f5b3205..ff584bb92365d137590e4aac2637e1e824e4c6b2 100644 (file)
@@ -3,6 +3,7 @@
 
 #pragma once
 
+#include <algorithm>
 #include <fmt/format.h>
 #include <fmt/ostream.h>
 
@@ -357,10 +358,10 @@ public:
             << "WARNING: sync lock latency elevated, halving concurrency."
             << " avg_latency_ms=" << std::chrono::duration_cast<std::chrono::milliseconds>(avg_latency()).count()
             << " threshold_ms=" << std::chrono::duration_cast<std::chrono::milliseconds>(threshold).count()
-            << " concurrency=" << (concurrency / 2) << dendl;
+            << " concurrency=" << std::max(int64_t{1}, concurrency / 2) << dendl;
         state = State::Throttled;
       }
-      return concurrency / 2;
+      return std::max(int64_t{1}, concurrency / 2);
     } else [[likely]] {
       if (state != State::Normal) [[unlikely]] {
         ldout(cct, 1)