Bug #70908
closedget_fragmentation_score crashes OSD while recovering from ONodes
0%
Description
We have a 17.2.8 cluster where we observed OSDs crashing on 'Allocator::get_fragmentation_score()'
This has happened during an upgrade process from Pacific when:
- An OSD is booting and running a full recovery from ONodes (as it previously crashed on https://tracker.ceph.com/issues/69764)
- An external process tries to get the bluestore allocator score block
The OSD crashes with
ceph version 17.2.8-4 (f817ceb7f187defb1d021d6328fa833eb8e943b3) quincy (stable) 1: /lib64/libpthread.so.0(+0x12990) [0x7f5c49e07990] 2: gsignal() 3: abort() 4: /usr/bin/ceph-osd(+0x64f9b8) [0x56311468c9b8] 5: /usr/bin/ceph-osd(+0xd57a6f) [0x563114d94a6f] 6: (Allocator::get_fragmentation_score()+0x119) [0x563114d94b99] 7: (Allocator::SocketHook::call(std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, ceph::buffer::v15_2_0::list const&, ceph::Formatter*, std::ostream&, ceph::buffer::v15_2_0::list&)+0x343) [0x563114d95f03] 8: (AdminSocketHook::call_async(std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, ceph::Formatter*, ceph::buffer::v15_2_0::list const&, std::function<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::buffer::v15_2_0::list&)>)+0x59c) [0x56311476cffc] 9: (AdminSocket::execute_command(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ceph::buffer::v15_2_0::list const&, std::function<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::buffer::v15_2_0::list&)>)+0x869) [0x563114e68a89] 10: (AdminSocket::execute_command(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ceph::buffer::v15_2_0::list const&, std::ostream&, ceph::buffer::v15_2_0::list*)+0x11e) [0x563114e692ae] 11: (AdminSocket::do_accept()+0x443) [0x563114e697e3] 12: (AdminSocket::entry()+0x4f0) [0x563114e6b7c0] 13: /lib64/libstdc++.so.6(+0xc2b23) [0x7f5c4944ab23] 14: /lib64/libpthread.so.0(+0x81ca) [0x7f5c49dfd1ca] 15: clone()
More context:
- The OSD starts recovery at 07:05
- The external process to get fragmentation score kicks in at 07:10, when OSD has not yet finished to recover from ONodes, crashing the OSD.
2025-04-09T07:05:48.968+0200 7f5c4bc046c0 4 rocksdb: EVENT_LOG_v1 {"time_micros": 1744175148969974, "job": 1, "event": "recovery_started", "wal_files": [46447, 46458, 46467]}
2025-04-09T07:05:48.968+0200 7f5c4bc046c0 4 rocksdb: [db/db_impl/db_impl_open.cc:845] Recovering log #46447 mode 2
2025-04-09T07:05:49.784+0200 7f5c4bc046c0 4 rocksdb: [db/db_impl/db_impl_open.cc:845] Recovering log #46458 mode 2
2025-04-09T07:05:50.344+0200 7f5c4bc046c0 4 rocksdb: [db/db_impl/db_impl_open.cc:845] Recovering log #46467 mode 2
2025-04-09T07:05:50.685+0200 7f5c4bc046c0 4 rocksdb: EVENT_LOG_v1 {"time_micros": 1744175150685846, "job": 1, "event": "recovery_finished"}
2025-04-09T07:05:50.685+0200 7f5c4bc046c0 1 bluestore(/var/lib/ceph/osd/ceph-204) _open_db opened rocksdb path db options compression=kNoCompression,max_write_buffer_number=4,min_write_buffer_number_to_merge=1,recycle_log_file_num=4,write_buffe
r_size=268435456,writable_file_max_buffer_size=0,compaction_readahead_size=2097152,max_background_compactions=2,max_total_wal_size=1073741824
2025-04-09T07:05:50.685+0200 7f5c4bc046c0 1 bluestore(/var/lib/ceph/osd/ceph-204) _open_super_meta old nid_max 89418220
2025-04-09T07:05:50.685+0200 7f5c4bc046c0 1 bluestore(/var/lib/ceph/osd/ceph-204) _open_super_meta old blobid_max 51200
2025-04-09T07:05:50.707+0200 7f5c4bc046c0 1 bluestore(/var/lib/ceph/osd/ceph-204) _open_super_meta ondisk_format 4 compat_ondisk_format 3
2025-04-09T07:05:50.707+0200 7f5c4bc046c0 1 bluestore(/var/lib/ceph/osd/ceph-204) _open_super_meta min_alloc_size 0x1000
2025-04-09T07:05:50.708+0200 7f5c4bc046c0 1 freelist init
2025-04-09T07:05:50.708+0200 7f5c4bc046c0 1 freelist _read_cfg
2025-04-09T07:05:50.856+0200 7f5c4bc046c0 -1 bluestore::NCB::__restore_allocator::Failed open_for_read with error-code -2
2025-04-09T07:05:50.856+0200 7f5c4bc046c0 0 bluestore(/var/lib/ceph/osd/ceph-204) _init_alloc::NCB::restore_allocator() failed! Run Full Recovery from ONodes (might take a while) ...
2025-04-09T07:10:33.361+0200 7f5c445e7700 -1 *** Caught signal (Aborted) **
in thread 7f5c445e7700 thread_name:admin_socket
Thanks,
Enrico
Files
DV Updated by Dan van der Ster over 1 year ago
- Project changed from Ceph to bluestore
- Category deleted (
OSD) - Source set to Community (user)
IF Updated by Igor Fedotov over 1 year ago
Hi Enrico,
could you please share the assertion message as well? It should be available from OSD log.
Thanks,
Igor
EB Updated by Enrico Bocchi over 1 year ago
Hi Igor,
Many thanks for looking into this.
Unfortunately, none of the OSDs affected by this crash show an assertion message in their logs.
Is there additional debug information I can provide you with?
Thanks,
Enrico
IF Updated by Igor Fedotov over 1 year ago
Enrico,
would you be able to reproduce the issue by killing OSD (kill -9) and asking for fragmentation score during its start up?
EB Updated by Enrico Bocchi over 1 year ago
Hi Igor,
Yes, this is very easy to reproduce.
Below is another example of the crash produced by kill -9 2 seconds after it logged "Run Full Recovery from ONodes". No assertion in this case either.
2025-05-05T17:25:08.873+0200 7ff3fece06c0 0 set uid:gid to 167:167 (ceph:ceph)
2025-05-05T17:25:08.873+0200 7ff3fece06c0 0 ceph version 17.2.8-4 (f817ceb7f187defb1d021d6328fa833eb8e943b3) quincy (stable), process ceph-osd, pid 718587
2025-05-05T17:25:08.873+0200 7ff3fece06c0 0 pidfile_write: ignore empty --pid-file
2025-05-05T17:25:08.875+0200 7ff3fece06c0 1 bdev(0x55bc047ba400 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:08.876+0200 7ff3fece06c0 1 bdev(0x55bc047ba400 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:08.876+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:08.876+0200 7ff3fece06c0 1 bdev(0x55bc047bb400 /var/lib/ceph/osd/ceph-1300/block.db) open path /var/lib/ceph/osd/ceph-1300/block.db
2025-05-05T17:25:08.877+0200 7ff3fece06c0 1 bdev(0x55bc047bb400 /var/lib/ceph/osd/ceph-1300/block.db) open size 160029474816 (0x2542800000, 149 GiB) block_size 4096 (4 KiB) non-rotational device, discard supported
2025-05-05T17:25:08.877+0200 7ff3fece06c0 1 bluefs add_block_device bdev 1 path /var/lib/ceph/osd/ceph-1300/block.db size 149 GiB
2025-05-05T17:25:08.877+0200 7ff3fece06c0 1 bdev(0x55bc047bb000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:08.877+0200 7ff3fece06c0 1 bdev(0x55bc047bb000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:08.877+0200 7ff3fece06c0 1 bluefs add_block_device bdev 2 path /var/lib/ceph/osd/ceph-1300/block size 13 TiB
2025-05-05T17:25:08.878+0200 7ff3fece06c0 1 bdev(0x55bc047bb400 /var/lib/ceph/osd/ceph-1300/block.db) close
2025-05-05T17:25:09.155+0200 7ff3fece06c0 1 bdev(0x55bc047bb000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:09.399+0200 7ff3fece06c0 1 bdev(0x55bc047ba400 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:09.653+0200 7ff3fece06c0 0 starting osd.1300 osd_data /var/lib/ceph/osd/ceph-1300 /var/lib/ceph/osd/ceph-1300/journal
2025-05-05T17:25:09.654+0200 7ff3fece06c0 -1 Falling back to public interface
2025-05-05T17:25:09.709+0200 7ff3fece06c0 0 load: jerasure load: lrc
2025-05-05T17:25:09.709+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:09.710+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:09.710+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:09.710+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:09.999+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:10.000+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:10.000+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:10.000+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:10.275+0200 7ff3fece06c0 0 osd.1300:0.OSDShard using op scheduler ClassedOpQueueScheduler(queue=WeightedPriorityQueue, cutoff=196)
2025-05-05T17:25:10.275+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:10.276+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:10.276+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:10.276+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:10.561+0200 7ff3fece06c0 0 osd.1300:1.OSDShard using op scheduler ClassedOpQueueScheduler(queue=WeightedPriorityQueue, cutoff=196)
2025-05-05T17:25:10.561+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:10.562+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:10.562+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:10.562+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:10.842+0200 7ff3fece06c0 0 osd.1300:2.OSDShard using op scheduler ClassedOpQueueScheduler(queue=WeightedPriorityQueue, cutoff=196)
2025-05-05T17:25:10.842+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:10.843+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:10.843+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:10.843+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:11.114+0200 7ff3fece06c0 0 osd.1300:3.OSDShard using op scheduler ClassedOpQueueScheduler(queue=WeightedPriorityQueue, cutoff=196)
2025-05-05T17:25:11.114+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:11.115+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:11.115+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:11.115+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) close
2025-05-05T17:25:11.385+0200 7ff3fece06c0 0 osd.1300:4.OSDShard using op scheduler ClassedOpQueueScheduler(queue=WeightedPriorityQueue, cutoff=196)
2025-05-05T17:25:11.386+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:11.386+0200 7ff3fece06c0 1 bdev(0x55bc055d0000 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:11.387+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _set_cache_sizes cache_size 1073741824 meta 0.45 kv 0.45 kv_onode 0.04 data 0.06
2025-05-05T17:25:11.387+0200 7ff3fece06c0 1 bdev(0x55bc055d1800 /var/lib/ceph/osd/ceph-1300/block.db) open path /var/lib/ceph/osd/ceph-1300/block.db
2025-05-05T17:25:11.388+0200 7ff3fece06c0 1 bdev(0x55bc055d1800 /var/lib/ceph/osd/ceph-1300/block.db) open size 160029474816 (0x2542800000, 149 GiB) block_size 4096 (4 KiB) non-rotational device, discard supported
2025-05-05T17:25:11.388+0200 7ff3fece06c0 1 bluefs add_block_device bdev 1 path /var/lib/ceph/osd/ceph-1300/block.db size 149 GiB
2025-05-05T17:25:11.388+0200 7ff3fece06c0 1 bdev(0x55bc055d1c00 /var/lib/ceph/osd/ceph-1300/block) open path /var/lib/ceph/osd/ceph-1300/block
2025-05-05T17:25:11.388+0200 7ff3fece06c0 1 bdev(0x55bc055d1c00 /var/lib/ceph/osd/ceph-1300/block) open size 14000515448832 (0xcbbbfc00000, 13 TiB) block_size 4096 (4 KiB) rotational device, discard not supported
2025-05-05T17:25:11.388+0200 7ff3fece06c0 1 bluefs add_block_device bdev 2 path /var/lib/ceph/osd/ceph-1300/block size 13 TiB
2025-05-05T17:25:11.389+0200 7ff3fece06c0 1 bluefs mount
2025-05-05T17:25:11.389+0200 7ff3fece06c0 1 bluefs _init_alloc new, id 1, allocator name bluefs-db, allocator type hybrid, capacity 0x2542800000, block size 0x100000
2025-05-05T17:25:11.389+0200 7ff3fece06c0 1 bluefs _init_alloc shared, id 2, capacity 0xcbbbfc00000, block size 0x10000
2025-05-05T17:25:11.854+0200 7ff3fece06c0 1 bluefs mount shared_bdev_used = 0
2025-05-05T17:25:11.854+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _prepare_db_environment set db_paths to db,152028001075 db.slow,13300489676390
2025-05-05T17:25:11.857+0200 7ff3fece06c0 4 rocksdb: RocksDB version: 6.15.5
[...]
2025-05-05T17:25:11.864+0200 7ff3fece06c0 4 rocksdb: EVENT_LOG_v1 {"time_micros": 1746458711865623, "job": 1, "event": "recovery_started", "wal_files": [44507]}
2025-05-05T17:25:11.864+0200 7ff3fece06c0 4 rocksdb: [db/db_impl/db_impl_open.cc:845] Recovering log #44507 mode 2
2025-05-05T17:25:11.868+0200 7ff3fece06c0 4 rocksdb: EVENT_LOG_v1 {"time_micros": 1746458711869261, "job": 1, "event": "recovery_finished"}
2025-05-05T17:25:11.868+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _open_db opened rocksdb path db options compression=kNoCompression,max_write_buffer_number=4,min_write_buffer_number_to_merge=1,recycle_log_file_num=4,write_buffer_size=268435456,writable_file_max_buffer_size=0,compaction_readahead_size=2097152,max_background_compactions=2,max_total_wal_size=1073741824
2025-05-05T17:25:11.868+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _open_super_meta old nid_max 52976171
2025-05-05T17:25:11.868+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _open_super_meta old blobid_max 153644
2025-05-05T17:25:11.870+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _open_super_meta ondisk_format 4 compat_ondisk_format 3
2025-05-05T17:25:11.870+0200 7ff3fece06c0 1 bluestore(/var/lib/ceph/osd/ceph-1300) _open_super_meta min_alloc_size 0x10000
2025-05-05T17:25:11.871+0200 7ff3fece06c0 1 freelist init
2025-05-05T17:25:11.871+0200 7ff3fece06c0 1 freelist _read_cfg
2025-05-05T17:25:11.876+0200 7ff3fece06c0 -1 bluestore::NCB::__restore_allocator::No Valid allocation info on disk (empty file)
2025-05-05T17:25:11.876+0200 7ff3fece06c0 0 bluestore(/var/lib/ceph/osd/ceph-1300) _init_alloc::NCB::restore_allocator() failed! Run Full Recovery from ONodes (might take a while) ...
2025-05-05T17:25:13.412+0200 7ff3f76c3700 -1 *** Caught signal (Aborted) **
in thread 7ff3f76c3700 thread_name:admin_socket
ceph version 17.2.8-4 (f817ceb7f187defb1d021d6328fa833eb8e943b3) quincy (stable)
1: /lib64/libpthread.so.0(+0x12990) [0x7ff3fcee3990]
2: gsignal()
3: abort()
4: /usr/bin/ceph-osd(+0x64f9b8) [0x55bc010729b8]
5: /usr/bin/ceph-osd(+0xd57a6f) [0x55bc0177aa6f]
6: (Allocator::get_fragmentation_score()+0x119) [0x55bc0177ab99]
7: (Allocator::SocketHook::call(std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, ceph::buffer::v15_2_0::list const&, ceph::Formatter*, std::ostream&, ceph::buffer::v15_2_0::list&)+0x343) [0x55bc0177bf03]
8: (AdminSocketHook::call_async(std::basic_string_view<char, std::char_traits<char> >, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > >, std::less<void>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::variant<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long, double, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::vector<long, std::allocator<long> >, std::vector<double, std::allocator<double> > > > > > const&, ceph::Formatter*, ceph::buffer::v15_2_0::list const&, std::function<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::buffer::v15_2_0::list&)>)+0x59c) [0x55bc01152ffc]
9: (AdminSocket::execute_command(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ceph::buffer::v15_2_0::list const&, std::function<void (int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ceph::buffer::v15_2_0::list&)>)+0x869) [0x55bc0184ea89]
10: (AdminSocket::execute_command(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, ceph::buffer::v15_2_0::list const&, std::ostream&, ceph::buffer::v15_2_0::list*)+0x11e) [0x55bc0184f2ae]
11: (AdminSocket::do_accept()+0x443) [0x55bc0184f7e3]
12: (AdminSocket::entry()+0x4f0) [0x55bc018517c0]
13: /lib64/libstdc++.so.6(+0xc2b23) [0x7ff3fc526b23]
14: /lib64/libpthread.so.0(+0x81ca) [0x7ff3fced91ca]
15: clone()
NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
AK Updated by Adam Kupczyk over 1 year ago
- Assignee set to Jaya Prakash
JP Updated by Jaya Prakash about 1 year ago
- Status changed from New to Need More Info
Hi @ebocchi,
I tried the steps to reproduce the issue, but failed to see a crash
I also called get_fragmentation_score() in multiple places when we had a restore allocator from Full Recovery from ONodes, but I still couldn’t trigger the crash.
Could you share logs with --debug_bdev=20/20 and --debug_bluestore=20/20? We can look into it more with those logs.
MK Updated by Maksym Krasilnikov 4 months ago
Jaya Prakash wrote in #note-7:
Hi @ebocchi,
I tried the steps to reproduce the issue, but failed to see a crash
I also called get_fragmentation_score() in multiple places when we had a restore allocator from Full Recovery from ONodes, but I still couldn’t trigger the crash.
Could you share logs with --debug_bdev=20/20 and --debug_bluestore=20/20? We can look into it more with those logs.
I have hit the same issue.
Reproduced on 18.2.4 with root-cause analysis — the crash is `get_fragmentation_score()` on an empty allocator during NCB recovery
We hit this same crash on Ceph 18.2.4 (BlueStore). A monitoring job runs `ceph daemon osd.N bluestore allocator score block` every 5 minutes; any OSD that is rebuilding its allocator from ONodes after an unclean s
hutdown aborts each time the probe fires, on the 5-minute cadence, until recovery completes.
Crash record (18.2.4):
abort()
(Allocator::get_fragmentation_score()+0x367)
(AdminSocket::execute_command(...))
...
Note there is no `assert_condition` — this is a bare `abort()`, not a `ceph_assert`.
Root cause (from source): `Allocator::get_fragmentation_score()` computes `sum` over the free extents. During NCB recovery, `read_allocation_from_onodes()` rebuilds the free list into a temporary `SimpleBitmap
` and only copies it into the live allocator at the very end (`copy_simple_bitmap_to_allocator`). The allocator's admin-socket hook, however, is registered at allocator construction, so for the entire multi-minute
scan the allocator is live but empty (0 free extents). With `sum 0`, `get_score(0)` produces a bucket index of `SIZE_MAX`, which indexes the fixed `scales[]` table out of bounds → `abort()` under libstdc++ `_G
LIBCXX_ASSERTIONS`.
Why it's hard to reproduce on demand (re the Nov 2025 "Need More Info"): the score query must land in the window where the allocator exists but is still empty. It reproduces reliably only with a large/slow ONo
de rebuild and a periodic probe firing during it — e.g. a per-OSD fragmentation exporter on a cron, exactly our setup.
Still present in 18.2.x, 19.2.x, and `main` (function unchanged aside from a cosmetic score-label term); no linked PR/backport as of this writing. A guard on the empty-allocator case (`sum 0`) would appear to r
esolve it.
A monitoring cron runs `ceph daemon osd.N bluestore allocator score block` every 5 minutes.
Each returning OSD aborts on the 5-minute boundary; within a burst the OSDs fall in the
script's iteration order, ~6 s apart, until recovery completes:
15:05:15 osd.149 15:10:08 osd.140 15:15:08 osd.140 15:20:08 osd.140
15:05:21 osd.150 15:10:15 osd.149 15:15:15 osd.149 15:20:15 osd.149
15:05:27 osd.159 15:10:21 osd.150 15:15:21 osd.150 15:20:23 osd.150
15:05:34 osd.160 15:10:28 osd.159 15:15:27 osd.159 15:20:31 osd.159
... ... ... ... ... ... (through osd.190)
15:06:12 osd.190 15:11:13 osd.190 15:16:12 osd.190 15:21:15 osd.190
- then the last-to-recover OSD alone, still every 5 min on the dot:
16:50:06 osd.140 16:55:06 osd.140 17:00:06 osd.140 17:05:05 osd.140 17:10:05 osd.140
The abort cadence == the cron cadence (*/5). The crashes stop for each OSD once its allocator
finishes rebuilding (free extents > 0). This is the reproduction: a periodic `allocator score`
probe + OSDs recovering from ONodes after an unclean shutdown.
Log in the attach is at default log levels. Capturing debug=20 requires the score query to land inside
the (multi-minute) ONode-rebuild window, which on a production host means deliberately re-crashing
a recovering OSD — so we have not captured a debug-20 trace live. The window is deterministic,
though: (1) stop an OSD uncleanly so NCB restore fails and it runs "Full Recovery from ONodes";
(2) while that scan is in progress, call `ceph daemon osd.N bluestore allocator score block`;
(3) it aborts because the allocator is still empty (sum==0).
IF Updated by Igor Fedotov 4 months ago
- Status changed from Need More Info to Fix Under Review
- Pull request ID set to 70528
IF Updated by Igor Fedotov 4 months ago
Hey Maksym,
thanks for the RCA, it was really helpful.
IF Updated by Igor Fedotov 4 months ago
- Backport set to umbrella, tentacle, squid
UB Updated by Upkeep Bot 3 months ago
- Status changed from Fix Under Review to Pending Backport
- Merge Commit set to 535333a80c57e0384c1249051c035aaf81ec7e11
- Fixed In set to v21.3.0-3077-g535333a80c
- Upkeep Timestamp set to 2026-09-08T13:19:50+00:00
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80395: squid: get_fragmentation_score crashes OSD while recovering from ONodes added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80396: tentacle: get_fragmentation_score crashes OSD while recovering from ONodes added
UB Updated by Upkeep Bot 3 months ago
- Copied to Backport #80397: umbrella: get_fragmentation_score crashes OSD while recovering from ONodes added
UB Updated by Upkeep Bot 3 months ago
- Status changed from Pending Backport to Backporting
- Upkeep Timestamp changed from 2026-09-08T13:19:50+00:00 to 2026-09-09T00:46:37+00:00