Skip to content

mon, osd: set subsystem prefix for logging MonCap and OSDCap#50312

Merged
yuriw merged 1 commit intoceph:mainfrom
rishabh-d-dave:ceph-caps-improvements
May 25, 2023
Merged

mon, osd: set subsystem prefix for logging MonCap and OSDCap#50312
yuriw merged 1 commit intoceph:mainfrom
rishabh-d-dave:ceph-caps-improvements

Conversation

@rishabh-d-dave
Copy link
Contributor

@rishabh-d-dave rishabh-d-dave commented Feb 28, 2023

Set subsys and prefix for logging in MonCap and OSDCap

Figured out this set of changes while working on PR #41779.

With this patch following is how log entries from MonCap.cc look -

2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap is_capable service=mon command= read addr v2:192.168.29.90:40719/0 on cap allow *
2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap  allow so far , doing grant allow *
2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap  allow all

And this is how same log entries from MonCap.cc look without this patch -

2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20 is_capable service=mon command= read addr v2:192.168.29.90:40164/0 on cap allow *
2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20  allow so far , doing grant allow *
2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20  allow all

Here are the links to these log entries in the codebase -
https://github.com/ceph/ceph/blob/main/src/mon/MonCap.cc#L459
https://github.com/ceph/ceph/blob/main/src/mon/MonCap.cc#L471
https://github.com/ceph/ceph/blob/main/src/mon/MonCap.cc#L484

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from 400a885 to 6e3f93a Compare March 8, 2023 19:27
@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch 2 times, most recently from 5b4c908 to 90d32ae Compare March 9, 2023 06:45
@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

Copy link
Member

@batrick batrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support adding debugging facilities here, good initiative.

Am I correct that every caller of these caps is using g_ceph_context? I'd prefer to do away with this argument entirely and hard-code g_ceph_context wherever needed.

@rishabh-d-dave
Copy link
Contributor Author

rishabh-d-dave commented Mar 10, 2023

@batrick

I support adding debugging facilities here, good initiative.

Am I correct that every caller of these caps is using g_ceph_context?

Yes.

I'd prefer to do away with this argument entirely and hard-code g_ceph_context wherever needed.

Hardcode as in create data member in class/struct, right?

I like this idea, I think its indeed better. @rzarzynski Any opinion?

@batrick
Copy link
Member

batrick commented Mar 13, 2023

I'd prefer to do away with this argument entirely and hard-code g_ceph_context wherever needed.

Hardcode as in create data member in class/struct, right?

No. g_ceph_context is an external variable global to all Ceph code. Just reference that.

@rzarzynski
Copy link
Contributor

👍 for g_ceph_context.

@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from 90d32ae to bae1799 Compare March 14, 2023 17:39
@rishabh-d-dave rishabh-d-dave requested a review from batrick March 17, 2023 06:46
@rishabh-d-dave
Copy link
Contributor Author

@batrick @rzarzynski Please take a look.

@rishabh-d-dave
Copy link
Contributor Author

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check

@rishabh-d-dave
Copy link
Contributor Author

@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from bae1799 to 411ad68 Compare March 17, 2023 08:14
Copy link
Member

@batrick batrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

@rishabh-d-dave
Copy link
Contributor Author

@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from 411ad68 to 4cf6b6f Compare March 17, 2023 17:25
@rishabh-d-dave
Copy link
Contributor Author

@athanatos

./do_cmake.sh -DWITH_SEASTAR=ON to build crimson. Anything used in crimson indeed cannot use g_ceph_context, so please leave it out of MonCap.

Okay. I'll revert the changes in MonCap in this case.

On running ./do_cmake.sh -DWITH_SEASTAR=ON I see the following error. Is anything more required?

-- Performing Test StdAtomic_EXPLICIT_LINK                                                                                                                                                                                                    
-- Performing Test StdAtomic_EXPLICIT_LINK - Success                                                                                                                                                                                          
-- Found StdAtomic: -latomic                                                                                                                                                                                                                  
-- Found lksctp-tools: /usr/lib64/libsctp.so                                                                                                                                                                                                  
-- Found numactl: /usr/lib64/libnuma.so                                                                                                                                                                                                       
-- Checking for one of the modules 'yaml-cpp'                                                                                                                                                                                                 
-- Found yaml-cpp: /usr/lib64/libyaml-cpp.so (found suitable version "0.6.3", minimum required is "0.5.1")                                                                                                                                    
-- Found ragel: /usr/bin/ragel (found suitable version "7.0.0.12", minimum required is "6.10")                                                                                                                                                
-- Found PthreadSetName: 1                                                                                                                                                                                                                    
-- Found Valgrind: /usr/include                                                                                                                                                                                                               
CMake Error at src/seastar/CMakeLists.txt:782 (message):                                                                                                                                                                                      
  Sanitizers not found!                                                                                                                                                                                                                       
                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                              
-- Configuring incomplete, errors occurred!                                           

@athanatos ping

@athanatos
Copy link
Contributor

You are most likely missing a package in your build environment -- one of the ones related to address sanitizer most likely. You should also be using a recent version of gcc -- 12 if you can.

@ljflores
Copy link
Member

This is marked as ready for testing (approved + "needs-qa"), but I'm seeing some comments that it might not be ready. Let me know if it's ready.

@vshankar
Copy link
Contributor

vshankar commented Apr 3, 2023

MDS changes LGTM.

@rishabh-d-dave
Copy link
Contributor Author

rishabh-d-dave commented Apr 5, 2023

I am dropping the changes in MonCapGrant::get_allowed() and MonCap::is_capable() since I am told that g_ceph_context is not to be used in MonCap at all.

@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from e47f9a6 to 77e2ed6 Compare April 5, 2023 13:18
@rishabh-d-dave rishabh-d-dave changed the title mon, osd, mds: use g_ceph_context for logging directly mon, osd: add debugging facilities in MonCap and OSDCap Apr 5, 2023
@rishabh-d-dave rishabh-d-dave requested a review from vshankar April 10, 2023 17:00
@rishabh-d-dave rishabh-d-dave changed the title mon, osd: add debugging facilities in MonCap and OSDCap mon, osd: set subsystem prefix for logging MonCap and OSDCap Apr 11, 2023
@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from 77e2ed6 to d43b2e7 Compare April 11, 2023 13:39
With this patch following is how log entries from MonCap.cc look -

    2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap is_capable service=mon command= read addr v2:192.168.29.90:40719/0 on cap allow *
    2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap  allow so far , doing grant allow *
    2023-04-10T22:15:25.746+0530 7fa5debf46c0 20 MonCap  allow all

And this is how same log entries from MonCap.cc look without this patch -

    2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20 is_capable service=mon command= read addr v2:192.168.29.90:40164/0 on cap allow *
    2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20  allow so far , doing grant allow *
    2023-04-10T22:23:32.214+0530 7f1fb27f46c0 20  allow all

Signed-off-by: Rishabh Dave <ridave@redhat.com>
@rishabh-d-dave rishabh-d-dave force-pushed the ceph-caps-improvements branch from d43b2e7 to aacc9fc Compare April 11, 2023 14:32
@batrick
Copy link
Member

batrick commented Apr 11, 2023

@ljflores this is ready now.

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@rishabh-d-dave
Copy link
Contributor Author

@rishabh-d-dave
Copy link
Contributor Author

jenkins test make check arm64

@ljflores
Copy link
Member

ljflores commented May 8, 2023

Rados suite results: http://pulpito.front.sepia.ceph.com/?branch=wip-yuri7-testing-2023-04-19-1343

Failures, unrelated:
1. https://tracker.ceph.com/issues/57755
2. https://tracker.ceph.com/issues/58946
3. https://tracker.ceph.com/issues/49888
4. https://tracker.ceph.com/issues/59380
5. https://tracker.ceph.com/issues/57754
6. https://tracker.ceph.com/issues/55347
7. https://tracker.ceph.com/issues/49287

Details:
1. task/test_orch_cli: test_cephfs_mirror times out - Ceph - Orchestrator
2. cephadm: KeyError: 'osdspec_affinity' - Ceph - Mgr - Dashboard
3. rados/singleton: radosbench.py: teuthology.exceptions.MaxWhileTries: reached maximum tries (3650) after waiting for 21900 seconds - Ceph - RADOS
4. rados/singleton-nomsgr: test failing from "Health check failed: 1 full osd(s) (OSD_FULL)" and "Health check failed: 1 filesystem is offline (MDS_ALL_DOWN)" - Ceph - RGW
5. test_envlibrados_for_rocksdb.sh: update-alternatives: error: alternative path /usr/bin/gcc-11 doesn't exist - Ceph - RADOS
6. SELinux Denials during cephadm/workunits/test_cephadm - Ceph - Orchestrator
7. podman: setting cgroup config for procHooks process caused: Unit libpod-$hash.scope not found - Ceph - Orchestrator

@kotreshhr
Copy link
Contributor

jenkins test windows

@kotreshhr
Copy link
Contributor

jenkins test make check arm64

1 similar comment
@kotreshhr
Copy link
Contributor

jenkins test make check arm64

Copy link
Contributor

@rzarzynski rzarzynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@yuriw yuriw merged commit 44d9649 into ceph:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants