Skip to content

Commit

Permalink
Added printing of log lines at OSD booting
Browse files Browse the repository at this point in the history
Signed-off-by: pdivyagowri <[email protected]>
  • Loading branch information
Divya-78 committed Feb 5, 2025
1 parent 327a5c1 commit 88b7e77
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions tests/rados/test_bluestore_min_alloc_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ def run(ceph_cluster, **kw):

daemon_alloc_size_hdd = int(json_out["bluestore_min_alloc_size_hdd"])
daemon_alloc_size_ssd = int(json_out["bluestore_min_alloc_size_ssd"])
log.debug(
f"Bluestore min alloc size hdd for daemon config show is: {daemon_alloc_size_hdd}"
)
log.debug(
f"Bluestore min alloc size ssd for daemon config show is: {daemon_alloc_size_ssd}"
)

if not (
daemon_alloc_size_hdd
Expand All @@ -180,8 +186,6 @@ def run(ceph_cluster, **kw):
raise Exception("The output from ceph daemon is not as expected")
log.info("Ceph daemon is verified")

return 0

mon_obj.set_config(
section="osd",
name="bluestore_min_alloc_size_hdd",
Expand Down Expand Up @@ -225,12 +229,41 @@ def remove_osd_check_metadata(target_osd, alloc_size):

# Adding the removed OSD back and checking the cluster status

start_time, _ = test_host.exec_command(
cmd="sudo date '+%Y-%m-%d %H:%M:%S'"
)

log.debug("Adding the removed OSD back and checking the cluster status")
utils.add_osd(ceph_cluster, test_host.hostname, dev_path, target_osd)
method_should_succeed(
wait_for_device_rados, test_host, target_osd, action="add"
)
time.sleep(30)

end_time, _ = test_host.exec_command(
cmd="sudo date '+%Y-%m-%d %H:%M:%S'"
)

log_veri = rados_obj.get_journalctl_log(
start_time=start_time,
end_time=end_time,
daemon_type="osd",
daemon_id=target_osd,
)
log.debug(f"The log lines for the OSD: {target_osd} is :{log_veri}")

# If _open_super_meta min_alloc_size is found in the logs, print the log lines
if f"_open_super_meta min_alloc_size {hex(4096)}" in log_veri:
log.info(
f"Found '_open_super_meta min_alloc_size {hex(4096)}' in the logs for OSD {target_osd}"
)
else:
log.error(
f"Error: '_open_super_meta min_alloc_size' not found in the logs for OSD {target_osd}"
)
raise Exception(f"Desired log '_open_super_meta min_alloc_size {hex(4096)}'"
"not found for OSD {target_osd}")

log.debug(
"Completed addition of OSD post removal. Checking bluestore_min_alloc_size value post OSD addition"
)
Expand Down Expand Up @@ -267,12 +300,12 @@ def remove_osd_check_metadata(target_osd, alloc_size):

show_config_hdd = int(
mon_obj.show_config(
daemon="osd", id=osd_id, param="bluestore_min_alloc_size_hdd"
daemon="osd", id=rm_osd, param="bluestore_min_alloc_size_hdd"
)
)
show_config_ssd = int(
mon_obj.show_config(
daemon="osd", id=osd_id, param="bluestore_min_alloc_size_ssd"
daemon="osd", id=rm_osd, param="bluestore_min_alloc_size_ssd"
)
)

Expand All @@ -288,11 +321,17 @@ def remove_osd_check_metadata(target_osd, alloc_size):

# determine osd's block device path
json_out = mon_obj.daemon_config_show(
daemon_type="osd", daemon_id=osd_id
daemon_type="osd", daemon_id=rm_osd
)

daemon_alloc_size_hdd = int(json_out["bluestore_min_alloc_size_hdd"])
daemon_alloc_size_ssd = int(json_out["bluestore_min_alloc_size_ssd"])
log.debug(
f"Bluestore min alloc size hdd for daemon config show is: {daemon_alloc_size_hdd}"
)
log.debug(
f"Bluestore min alloc size ssd for daemon config show is: {daemon_alloc_size_ssd}"
)

if not (
daemon_alloc_size_hdd
Expand Down

0 comments on commit 88b7e77

Please sign in to comment.