Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure rbd-mirror debug logs dynamically #1346

Merged
merged 6 commits into from
Apr 30, 2024

Conversation

nirs
Copy link
Member

@nirs nirs commented Apr 17, 2024

Configure rbd-mirror debug logs dynamically

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 /data/rook/rook-ceph/log'
    9e67de2a-c3eb-4a06-a8b5-444bff716362-client.rbd-mirror-peer.log  ceph-client.rbd-mirror.a.log  ceph-volume.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

Status

@nirs nirs force-pushed the drenv-rbd-mirror-debug branch 5 times, most recently from a9a69bc to 7ca1d82 Compare April 17, 2024 21:19
@nirs nirs marked this pull request as ready for review April 17, 2024 21:25
@nirs nirs marked this pull request as draft April 18, 2024 14:17
@nirs nirs force-pushed the drenv-rbd-mirror-debug branch 2 times, most recently from 137c1d8 to 5ebca81 Compare April 18, 2024 14:45
nirs added 5 commits April 30, 2024 16:48
This makes testing changes much easier, for example, to test that the
kustomization creates a correct yaml, you can use:

    kustomize build addon/rook-cluster

And since we support caching kustomization results, it is easy to cache
now all rook resources.

The downside of this change is increasing rook version duplication.
Before it was duplicated in 3 times in 3 files, now it is duplicated 5
times in 3 files. We need to improve this later.

Signed-off-by: Nir Soffer <[email protected]>
Enabling debug logs creates huge logs that can can fill up the node disk
if you leave a test environment running for long time. The log collector
rotates log files to avoid this issue.

With this change all ceph daemons log to file:

    $ minikube ssh -p dr1 'ls -lh /data/rook/rook-ceph/log'
    total 3.9M
    -rw-r--r-- 1 167 167 453K Apr 18 14:08 20464565-c3dd-430f-830f-297dd03864bd-client.rbd-mirror-peer.log
    -rw-r--r-- 1 167 167  91K Apr 18 14:08 ceph-client.ceph-exporter.log
    -rw-r--r-- 1 167 167 1.8M Apr 18 14:08 ceph-client.rbd-mirror.a.log
    -rw-r--r-- 1 167 167 326K Apr 18 14:08 ceph-mgr.a.log
    -rw-r--r-- 1 167 167 234K Apr 18 14:08 ceph-mon.a.log
    -rw-r--r-- 1 167 167 1.1M Apr 18 14:07 ceph-osd.0.log
    -rw-r--r-- 1 167 167  17K Apr 18 13:57 ceph-volume.log

This is probably not needed, but it may help debugging issue in ceph.
Sine all logs expect rbd-mirror logs are not using debug level it
should not be a problem, and since logs are rotated the amount of data
should be limited.

Unfinished:
- Check how many logs files are kept after rotation
- Update gather tool to gather also rotated logs files

Signed-off-by: Nir Soffer <[email protected]>
This reverts commit c5e221b.

Signed-off-by: Nir Soffer <[email protected]>
This reverts commit 832a5e1.

Signed-off-by: Nir Soffer <[email protected]>
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]>
@nirs nirs force-pushed the drenv-rbd-mirror-debug branch from 0d23498 to 7b93c77 Compare April 30, 2024 14:04
For testing the fix to bug[1], Ilia asked to run without debug logs,
since they make the issue much harder to reproduce. Add an environment
variable RBD_MIRROR_DEBUG=0 to disable debug logs. We enable debug logs
by default so issues in CI or developers environment will have useful
logs by default.

The new environment variable may also be useful for developers keeping
an environment for long time and want to avoid collecting hundreds of
megabytes of debug logs.

Example usage:

    # Starting environment without debug logs
    $ RBD_MIRROR_DEBUG=0 drenv start envs/rook.yaml
    ...

    # Disabling debug logs on running environment
    $ RBD_MIRROR_DEBUG=0 addons/rbd-mirror/start dr1 dr2
    Disable rbd-mirror debug logs in cluster 'dr1'
    Disable rbd-mirror debug logs in cluster 'dr2'
    Getting mirroring info site name for cluster 'dr1'
    ...

    # Enabling debug logs on running environment
    $ addons/rbd-mirror/start dr1 dr2
    $ addons/rbd-mirror/start dr1 dr2
    Enable rbd-mirror debug logs in cluster 'dr1'
    Enable rbd-mirror debug logs in cluster 'dr2'
    Getting mirroring info site name for cluster 'dr1'
    ...

[1] https://tracker.ceph.com/issues/65487#note-20

Signed-off-by: Nir Soffer <[email protected]>
@nirs nirs force-pushed the drenv-rbd-mirror-debug branch from 7b93c77 to 4705692 Compare April 30, 2024 15:30
@nirs nirs marked this pull request as ready for review April 30, 2024 16:19
@raghavendra-talur raghavendra-talur merged commit 64d0b8c into RamenDR:main Apr 30, 2024
16 checks passed
@nirs nirs deleted the drenv-rbd-mirror-debug branch April 30, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants