]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: concurrency adjustment - consider the case caller provides 1 68803/head
authorOguzhan Ozmen <oozmen@bloomberg.net>
Wed, 29 Apr 2026 21:36:48 +0000 (21:36 +0000)
committerOguzhan Ozmen <oozmen@bloomberg.net>
Thu, 7 May 2026 19:01:41 +0000 (19:01 +0000)
Signed-off-by: Oguzhan Ozmen <oozmen@bloomberg.net>
(cherry picked from commit 7839519a18c5789ebd7579a674c14cf353c3e027)

src/rgw/driver/rados/rgw_data_sync.h

index 411c368b7b22e545a07350ada9638d669578dc8d..1d91427069c7d466fffc7dec1e9f66e0ccf04788 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)