Skip to content

Commit

Permalink
Configure rbd-mirror debug logs dynamically
Browse files Browse the repository at this point in the history
With our current configuration, the rbd-mirror-peer log is not created.
Iilya thinks[1] that this may be caused by the way we configure using
rook-config-override. Let's try to configure in the same way as
ocs-operator, using `ceph config set` commands[2].

With this configuration, the rbd-mirror-peer log is created:

    $ minikube ssh -p dr1 'ls -1 /data/rook/rook-ceph/log/*rbd-mirror*.log'
    /data/rook/rook-ceph/log/20464565-c3dd-430f-830f-297dd03864bd-client.rbd-mirror-peer.log
    /data/rook/rook-ceph/log/ceph-client.rbd-mirror.a.log

[1] https://tracker.ceph.com/issues/65487?issue_count=296&issue_position=1&next_issue_id=65481#note-12
[2] red-hat-storage/ocs-operator@e39bb41

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs authored and raghavendra-talur committed Apr 30, 2024
1 parent c53edcf commit 388b9e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/addons/rbd-mirror/start
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ def fetch_secret_info(cluster):
return info


def enable_rbd_mirror_debug_logs(cluster):
print(f"Enable rbd-mirror debug logs in cluster '{cluster}'")
for who in "client.rbd-mirror.a", "client.rbd-mirror-peer":
ceph.set_config(cluster, who, "debug_ms", "1")
ceph.set_config(cluster, who, "debug_rbd", "15")
ceph.set_config(cluster, who, "debug_rbd_mirror", "30")
ceph.set_config(cluster, who, "log_file", "/var/log/ceph/$cluster-$name.log")
ceph.set_config(cluster, "mgr", "mgr/rbd_support/log_level", "debug")


def configure_rbd_mirroring(cluster, peer_info):
print(f"Applying rbd mirror secret in cluster '{cluster}'")

Expand Down Expand Up @@ -219,6 +229,9 @@ os.chdir(os.path.dirname(__file__))
cluster1 = sys.argv[1]
cluster2 = sys.argv[2]

enable_rbd_mirror_debug_logs(cluster1)
enable_rbd_mirror_debug_logs(cluster2)

cluster1_info = fetch_secret_info(cluster1)
cluster2_info = fetch_secret_info(cluster2)

Expand Down
7 changes: 7 additions & 0 deletions test/drenv/ceph.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ def clear_osd_blocklist(cluster):
tool(cluster, "ceph", "osd", "blocklist", "clear")


def set_config(cluster, who, option, value):
"""
See https://docs.ceph.com/en/latest/rados/configuration/ceph-conf/#commands
"""
tool(cluster, "ceph", "config", "set", who, option, value)


def tool(cluster, *args):
return kubectl.exec(
"deploy/rook-ceph-tools",
Expand Down

0 comments on commit 388b9e7

Please sign in to comment.