]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: write require_osd_release only when needed
authorMatan Breizman <mbreizma@redhat.com>
Mon, 2 Sep 2024 13:54:05 +0000 (13:54 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Mon, 2 Sep 2024 14:04:10 +0000 (14:04 +0000)
Otherwise, we would invoke _write_bdev_label on each committed map:
```
DEBUG 2024-08-14 17:12:55,789 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:12:56,792 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:12:57,800 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:12:58,801 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:12:59,717 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:13:00,714 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
DEBUG 2024-08-14 17:13:01,812 [shard 0:main] bluestore - bluestore(/var/lib/ceph/osd/ceph-2/block) _write_bdev_label path /var/lib/ceph/osd/ceph-2/block label bdev(osd_uuid d2ce936a-24b4-415d-9979-c8d75a9ea0f4, size 0x1680000000, btime 2024-08-14T17:10:52.823128+0000, desc main, 16 meta) locations [0,1073741824,10737418240]
```

The continues `write_meta` calls misuse bdev replication.

Fixes: https://tracker.ceph.com/issues/67568
Co-authored-by: Adam Kupczyk <akupczyk@ibm.com>
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/crimson/osd/osd.cc
src/crimson/osd/osd.h

index 190ea47abd89e45d79e8878ba3e876085ada1c5d..560f0d2fd175ac144265cc61aea1e816029baee9 100644 (file)
@@ -1558,9 +1558,13 @@ seastar::future<> OSD::handle_peering_op(
 seastar::future<> OSD::check_osdmap_features()
 {
   assert(seastar::this_shard_id() == PRIMARY_CORE);
-  return store.write_meta(
-      "require_osd_release",
-      stringify((int)osdmap->require_osd_release));
+  if (osdmap->require_osd_release != last_require_osd_release) {
+    last_require_osd_release = osdmap->require_osd_release;
+    return store.write_meta(
+        "require_osd_release",
+        stringify((int)osdmap->require_osd_release));
+  }
+  return seastar::now();
 }
 
 seastar::future<> OSD::prepare_to_stop()
index 8df23c53f7a106c703baeb82cf387a1a1d9b1b6c..a4a81554094f1578ec804d7069f409a23ac20bcb 100644 (file)
@@ -234,6 +234,8 @@ private:
 private:
   crimson::common::Gated gate;
 
+  ceph_release_t last_require_osd_release{ceph_release_t::unknown};
+
   seastar::promise<> stop_acked;
   void got_stop_ack() {
     stop_acked.set_value();