Skip to content

Commit f628b13

Browse files
Matan-Baclamk
andcommitted
crimson/osd: write require_osd_release only when needed
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 <[email protected]> Signed-off-by: Matan Breizman <[email protected]>
1 parent 257a51e commit f628b13

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/crimson/osd/osd.cc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,9 +1558,13 @@ seastar::future<> OSD::handle_peering_op(
15581558
seastar::future<> OSD::check_osdmap_features()
15591559
{
15601560
assert(seastar::this_shard_id() == PRIMARY_CORE);
1561-
return store.write_meta(
1562-
"require_osd_release",
1563-
stringify((int)osdmap->require_osd_release));
1561+
if (osdmap->require_osd_release != last_require_osd_release) {
1562+
last_require_osd_release = osdmap->require_osd_release;
1563+
return store.write_meta(
1564+
"require_osd_release",
1565+
stringify((int)osdmap->require_osd_release));
1566+
}
1567+
return seastar::now();
15641568
}
15651569

15661570
seastar::future<> OSD::prepare_to_stop()

src/crimson/osd/osd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ class OSD final : public crimson::net::Dispatcher,
234234
private:
235235
crimson::common::Gated gate;
236236

237+
ceph_release_t last_require_osd_release{ceph_release_t::unknown};
238+
237239
seastar::promise<> stop_acked;
238240
void got_stop_ack() {
239241
stop_acked.set_value();

0 commit comments

Comments
 (0)