]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: option to limit in-flight appends 22983/head
authorMykola Golub <mgolub@suse.com>
Thu, 26 Jul 2018 12:24:33 +0000 (15:24 +0300)
committerMykola Golub <mgolub@suse.com>
Thu, 30 Aug 2018 14:07:39 +0000 (17:07 +0300)
Signed-off-by: Mykola Golub <mgolub@suse.com>
src/common/options.cc
src/librbd/ImageCtx.cc
src/librbd/ImageCtx.h
src/librbd/Journal.cc
src/librbd/journal/DemoteRequest.cc
src/librbd/journal/PromoteRequest.cc
src/test/librbd/fsx.cc
src/test/librbd/journal/test_mock_PromoteRequest.cc
src/test/librbd/mock/MockImageCtx.h
src/test/librbd/test_mock_Journal.cc
src/tools/rbd/action/Journal.cc

index b83918dae5c918c23f9f66742f1fddce3d1b120e..16cd2295bef8294b5b93001c576865a7774c1baf 100644 (file)
@@ -6593,6 +6593,10 @@ static std::vector<Option> get_rbd_options() {
     .set_default(0)
     .set_description("maximum age (in seconds) for pending commits"),
 
+    Option("rbd_journal_object_max_in_flight_appends", Option::TYPE_UINT, Option::LEVEL_ADVANCED)
+    .set_default(0)
+    .set_description("maximum number of in-flight appends per journal object"),
+
     Option("rbd_journal_pool", Option::TYPE_STR, Option::LEVEL_ADVANCED)
     .set_default("")
     .set_description("pool for journal objects"),
index 2c99f2cc68ced0e4797ccf6d6e572636ff355aba..57ea9597036e905009a5b15c9c4f06dc64ea101d 100644 (file)
@@ -793,6 +793,7 @@ public:
         "rbd_journal_object_flush_interval", false)(
         "rbd_journal_object_flush_bytes", false)(
         "rbd_journal_object_flush_age", false)(
+        "rbd_journal_object_max_in_flight_appends", false)(
         "rbd_journal_pool", false)(
         "rbd_journal_max_payload_bytes", false)(
         "rbd_journal_max_concurrent_object_sets", false)(
@@ -862,6 +863,7 @@ public:
     ASSIGN_OPTION(journal_object_flush_interval, int64_t);
     ASSIGN_OPTION(journal_object_flush_bytes, Option::size_t);
     ASSIGN_OPTION(journal_object_flush_age, double);
+    ASSIGN_OPTION(journal_object_max_in_flight_appends, uint64_t);
     ASSIGN_OPTION(journal_max_payload_bytes, Option::size_t);
     ASSIGN_OPTION(journal_max_concurrent_object_sets, int64_t);
     ASSIGN_OPTION(mirroring_resync_after_disconnect, bool);
index 62e76cff4f58a257411b0a44f5311a3c91ab1b90..89ae38bd9196b3352bff65e116accb579db8e07b 100644 (file)
@@ -196,6 +196,7 @@ namespace librbd {
     int journal_object_flush_interval;
     uint64_t journal_object_flush_bytes;
     double journal_object_flush_age;
+    uint64_t journal_object_max_in_flight_appends;
     std::string journal_pool;
     uint32_t journal_max_payload_bytes;
     int journal_max_concurrent_object_sets;
index d29ecfb2e25af1d12c673f0fad0bf2a594ed8206..6ff84335093d11e6c149bb737bd1e2b3bca5cd7f 100644 (file)
@@ -1168,7 +1168,8 @@ void Journal<I>::start_append() {
   ceph_assert(m_lock.is_locked());
   m_journaler->start_append(m_image_ctx.journal_object_flush_interval,
                            m_image_ctx.journal_object_flush_bytes,
-                           m_image_ctx.journal_object_flush_age);
+                           m_image_ctx.journal_object_flush_age,
+                            m_image_ctx.journal_object_max_in_flight_appends);
   transition_state(STATE_READY, 0);
 }
 
index c851beae57d289085298210d5833fe56f3206720..59aa0365a3f8d30e19aa8f9a32b55ae9a5ffc547 100644 (file)
@@ -135,7 +135,7 @@ void DemoteRequest<I>::append_event() {
   bufferlist event_entry_bl;
   encode(event_entry, event_entry_bl);
 
-  m_journaler->start_append(0, 0, 0);
+  m_journaler->start_append(0, 0, 0, 0);
   m_future = m_journaler->append(m_tag_tid, event_entry_bl);
 
   auto ctx = create_context_callback<
index 17651c2fd0b5a752dc9c4a90054e1e15f33bd08b..695acc388aaad67ea374f6f64a74172eb50b4713 100644 (file)
@@ -119,7 +119,7 @@ void PromoteRequest<I>::append_event() {
   bufferlist event_entry_bl;
   encode(event_entry, event_entry_bl);
 
-  m_journaler->start_append(0, 0, 0);
+  m_journaler->start_append(0, 0, 0, 0);
   m_future = m_journaler->append(m_tag_tid, event_entry_bl);
 
   auto ctx = create_context_callback<
index b0863e42aca218943093b610643db72683331b86..549538dabc8c534c8479f5c03aa291709155386e 100644 (file)
@@ -432,7 +432,7 @@ int replay_journal(rados_ioctx_t ioctx, const char *image_name,
                 return r;
         }
 
-        replay_journaler.start_append(0, 0, 0);
+        replay_journaler.start_append(0, 0, 0, 0);
 
         C_SaferCond replay_ctx;
         ReplayHandler replay_handler(&journaler, &replay_journaler,
index 9fa503ee903075b879a0e909fbb57ee7fdf2b6f5..0e61a88890d38887e4a08ee07e72eb4994005350 100644 (file)
@@ -120,7 +120,7 @@ public:
   }
 
   void expect_start_append(::journal::MockJournaler &mock_journaler) {
-    EXPECT_CALL(mock_journaler, start_append(_, _, _));
+    EXPECT_CALL(mock_journaler, start_append(_, _, _, _));
   }
 
   void expect_stop_append(::journal::MockJournaler &mock_journaler, int r) {
index e0f11e950b519d3b1d1d532c9589bbc316f0531b..3fd4432f157cea9a7f097a96d9b470fc11ae0bc4 100644 (file)
@@ -102,6 +102,8 @@ struct MockImageCtx {
       journal_object_flush_interval(image_ctx.journal_object_flush_interval),
       journal_object_flush_bytes(image_ctx.journal_object_flush_bytes),
       journal_object_flush_age(image_ctx.journal_object_flush_age),
+      journal_object_max_in_flight_appends(
+          image_ctx.journal_object_max_in_flight_appends),
       journal_pool(image_ctx.journal_pool),
       journal_max_payload_bytes(image_ctx.journal_max_payload_bytes),
       journal_max_concurrent_object_sets(
@@ -322,6 +324,7 @@ struct MockImageCtx {
   int journal_object_flush_interval;
   uint64_t journal_object_flush_bytes;
   double journal_object_flush_age;
+  uint64_t journal_object_max_in_flight_appends;
   std::string journal_pool;
   uint32_t journal_max_payload_bytes;
   int journal_max_concurrent_object_sets;
index 027706a6c5d684c75578724fb2e3406111092216..12f445d6c88bcec8dd6e24a3e7d8caf77ba3f6fa 100644 (file)
@@ -396,7 +396,7 @@ public:
   }
 
   void expect_start_append(::journal::MockJournaler &mock_journaler) {
-    EXPECT_CALL(mock_journaler, start_append(_, _, _));
+    EXPECT_CALL(mock_journaler, start_append(_, _, _, _));
   }
 
   void expect_stop_append(::journal::MockJournaler &mock_journaler, int r) {
index fb4d142c2cc9d549147256b6b785c41c6b7e712f..72663a1aa84a79f3cbf82c26419d966983886874 100644 (file)
@@ -832,7 +832,7 @@ public:
     if (r < 0) {
       return r;
     }
-    m_journaler.start_append(0, 0, 0);
+    m_journaler.start_append(0, 0, 0, 0);
 
     int r1 = 0;
     bufferlist bl;