Project

General

Profile

Actions

Bug #21770

closed

ceph mon core dump when use ceph osd perf cmd.

Added by linghucong linghucong over 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
High
Category:
Monitor
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

mon core dump log:

ions"} v 0) v1 ==== 80+0+0 (2443524295 0 0) 0x556a5e986ac0 con 0x556a5ef87000
11> 2017-10-12 14:54:01.541292 7f3506abf700 2 mon.node-1151@1(peon) e5 send_reply 0x556a5e98b700 0x556a5eb7d480 mon_command_ack([{"prefix": "get_command_descriptions"}]=0 v0) v1
-10> 2017-10-12 14:54:01.541310 7f3506abf700 1 -
10.11.1.151:6789/0 --> 10.11.1.151:0/1365702545 -- mon_command_ack([{"prefix": "get_command_descriptions"}]=0 v0) v1 -- 0x556a5eb7d480 con 0
9> 2017-10-12 14:54:01.683745 7f350a2c6700 5 - 10.11.1.151:6789/0 >> 10.11.1.151:0/1365702545 conn(0x556a5ef87000 :6789 s=STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH pgs=1 cs=1 l=1). rx client.254101 seq 8 0x556a5e987a80 mon_command({"prefix": "osd perf"} v 0) v1
8> 2017-10-12 14:54:01.683867 7f3506abf700 1 - 10.11.1.151:6789/0 <== client.254101 10.11.1.151:0/1365702545 8 ==== mon_command({"prefix": "osd perf"} v 0) v1 ==== 64+0+0 (3657706950 0 0) 0x556a5e987a80 con 0x556a5ef87000
7> 2017-10-12 14:54:01.683936 7f3506abf700 0 mon.node-1151@1(peon) e5 handle_command mon_command({"prefix": "osd perf"} v 0) v1
-6> 2017-10-12 14:54:01.683999 7f3506abf700 0 log_channel(audit) log [DBG] : from='client.? 10.11.1.151:0/1365702545' entity='client.admin' cmd=[{"prefix": "osd perf"}]: dispatch
-5> 2017-10-12 14:54:01.684005 7f3506abf700 10 log_client _send_to_monlog to self
-4> 2017-10-12 14:54:01.684008 7f3506abf700 10 log_client log_queue is 1 last_log 2 sent 1 num 1 unsent 1 sending 1
-3> 2017-10-12 14:54:01.684013 7f3506abf700 10 log_client will send 2017-10-12 14:54:01.684003 mon.node-1151 mon.1 10.11.1.151:6789/0 2 : audit [DBG] from='client.? 10.11.1.151:0/1365702545' entity='client.admin' cmd=[{"prefix": "osd perf"}]: dispatch
-2> 2017-10-12 14:54:01.684037 7f3506abf700 1 -
10.11.1.151:6789/0 --> 10.11.1.151:6789/0 -- log(1 entries from seq 2 at 2017-10-12 14:54:01.684003) v1 -- 0x556a5eb7cd00 con 0
-1> 2017-10-12 14:54:01.684063 7f3506abf700 5 mon.node-1151@1(peon).paxos(paxos active c 32129..32778) is_readable = 1 - now=2017-10-12 14:54:01.684064 lease_expire=2017-10-12 14:54:06.430298 has v0 lc 32778
0> 2017-10-12 14:54:01.689602 7f3506abf700 -1 ** Caught signal (Aborted) *
in thread 7f3506abf700 thread_name:ms_dispatch

ceph version 12.2.1 (3e7492b9ada8bdc9a5cd0feafd42fbca27f9c38e) luminous (stable)
1: (()+0x955dc4) [0x556a5400adc4]
2: (()+0x11390) [0x7f350f853390]
3: (gsignal()+0x38) [0x7f350dfa1428]
4: (abort()+0x16a) [0x7f350dfa302a]
5: (()+0x444489) [0x556a53af9489]
6: (OSDMonitor::preprocess_command(boost::intrusive_ptr&lt;MonOpRequest&gt;)+0xc59) [0x556a53be0a99]
7: (OSDMonitor::preprocess_query(boost::intrusive_ptr&lt;MonOpRequest&gt;)+0x2c0) [0x556a53bea5b0]
8: (PaxosService::dispatch(boost::intrusive_ptr&lt;MonOpRequest&gt;)+0x700) [0x556a53b94970]
9: (Monitor::handle_command(boost::intrusive_ptr&lt;MonOpRequest&gt;)+0x235a) [0x556a53a5a18a]
10: (Monitor::dispatch_op(boost::intrusive_ptr&lt;MonOpRequest&gt;)+0xa0e) [0x556a53a611ce]
11: (Monitor::_ms_dispatch(Message*)+0x6db) [0x556a53a6221b]
12: (Monitor::ms_dispatch(Message*)+0x23) [0x556a53a919e3]
13: (DispatchQueue::entry()+0xf4a) [0x556a53fb33da]
14: (DispatchQueue::DispatchThread::entry()+0xd) [0x556a53d64e3d]

ceph version:

ceph version 12.2.1 (3e7492b9ada8bdc9a5cd0feafd42fbca27f9c38e) luminous (stable)


Files

ceph-osd-perf-crash.txt (180 KB) ceph-osd-perf-crash.txt ceph-mon crash log Paul Emmerich, 11/04/2017 03:30 PM

Related issues 2 (0 open2 closed)

Related to Ceph - Bug #21527: "mgr_command_descs" not sync in the new join MonResolvedhuanwen ren09/23/2017

Actions
Related to Ceph - Bug #21986: ceph the second mon can not join the quorumClosed10/31/2017

Actions
Actions #1

Updated by Sage Weil over 6 years ago

  • Status changed from New to Need More Info
  • Priority changed from Normal to High

Is this reproducible? Can you generate a core file and install ceph-mon-dbg or ceph-debuginfo to get a backtrace? Revieweing the code I can't see where we might seg fault. Thanks!

Actions #2

Updated by linghucong linghucong over 6 years ago

thank you sage for review it. yes it can reproducible in our envirment. and it is vesy stange it

only happen in the second mon. I have three mon, when i use watch ceph osd perf, it will core dump

it the second mon. But if i remove the second mon and use watch ceph osd perf it will normal. I

will do it as you said later to see what is wrong with it.

Actions #3

Updated by linghucong linghucong over 6 years ago

Hi sage the below is the gdb trace.

(gdb) where
#0 0x00007fdc75ea6269 in raise (sig=6) at ../sysdeps/unix/sysv/linux/pt-raise.c:35
#1 0x0000559c16766e4e in ?? ()
#2 <signal handler called>
#3 0x00007fdc745f4428 in _GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#4 0x00007fdc745f602a in __GI_abort () at abort.c:89
#5 0x0000559c16255489 in PGStatService::process_pg_command(std::
_cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, 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<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, 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&, OSDMap const&, ceph::Formatter*, std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >, ceph::buffer::list) const ()
#6 0x0000559c1633ca99 in OSDMonitor::preprocess_command(boost::intrusive_ptr<MonOpRequest>) ()
#7 0x0000559c163465b0 in OSDMonitor::preprocess_query(boost::intrusive_ptr<MonOpRequest>) ()
#8 0x0000559c162f0970 in PaxosService::dispatch(boost::intrusive_ptr<MonOpRequest>) ()
#9 0x0000559c161b618a in Monitor::handle_command(boost::intrusive_ptr<MonOpRequest>) ()
#10 0x0000559c161bd1ce in Monitor::dispatch_op(boost::intrusive_ptr<MonOpRequest>) ()
#11 0x0000559c161be21b in Monitor::_ms_dispatch(Message*) ()
#12 0x0000559c161ed9e3 in Monitor::ms_dispatch(Message*) ()
#13 0x0000559c1670f3da in DispatchQueue::entry() ()
#14 0x0000559c164c0e3d in DispatchQueue::DispatchThread::entry() ()
#15 0x00007fdc75e9c6ba in start_thread (arg=0x7fdc6e153700) at pthread_create.c:333
#16 0x00007fdc746c63dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Actions #4

Updated by linghucong linghucong over 6 years ago

Hi sage i want to debug it myself. why i use gdb can not enter the funtion like below. I have install the mon-dbg. do i need to rebuild the ceph code and enable the -g option in makefile? thank you !

Thread 15 "ms_dispatch" hit Breakpoint 1, 0x0000559b25a9fe34 in Monitor::handle_command(boost::intrusive_ptr<MonOpRequest>) ()
(gdb) n
Single stepping until exit from function _ZN7Monitor14handle_commandEN5boost13intrusive_ptrI12MonOpRequestEE,
which has no line number information.
0x0000559b25aa91ce in Monitor::dispatch_op(boost::intrusive_ptr<MonOpRequest>) ()
(gdb) n
Single stepping until exit from function _ZN7Monitor11dispatch_opEN5boost13intrusive_ptrI12MonOpRequestEE,
which has no line number information.
0x0000559b25aaa21b in Monitor::_ms_dispatch(Message*) ()
(gdb) n
Single stepping until exit from function _ZN7Monitor12_ms_dispatchEP7Message,
which has no line number information.
0x0000559b25ad99e3 in Monitor::ms_dispatch(Message*) ()
(gdb) n
Single stepping until exit from function _ZN7Monitor11ms_dispatchEP7Message,
which has no line number information.
0x0000559b25ffb3da in DispatchQueue::entry() ()
(gdb) n

Actions #5

Updated by linghucong linghucong over 6 years ago

It mush be a bug. for the same command ceph pg dump. sometimes it will success.sometimes it will have the below error.it is very amazing.

root@node-1151:~# ceph -s
cluster:
id: 3edc30f3-2157-4251-b94c-2a81db839bc8
health: HEALTH_WARN
too many PGs per OSD (320 > max 300)

services:
mon: 3 daemons, quorum node-1150,node-1151,node-1152
mgr: node-1150(active), standbys: node-1152, node-1151
osd: 3 osds: 3 up, 3 in
data:
pools: 5 pools, 320 pgs
objects: 16605 objects, 95870 MB
usage: 287 GB used, 2509 GB / 2797 GB avail
pgs: 320 active+clean

root@node-1151:~# ceph pg dump
Error ENOTSUP: this command is obsolete

Actions #6

Updated by linghucong linghucong over 6 years ago

(gdb) bt
#0 0x00007ff1b4d35269 in raise (sig=6) at ../sysdeps/unix/sysv/linux/pt-raise.c:35
#1 0x000055e6ef92c62c in reraise_fatal (signum=6) at /home/ceph/ceph/src/global/signal_handler.cc:74
#2 0x000055e6ef92c9a4 in handle_fatal_signal (signum=6) at /home/ceph/ceph/src/global/signal_handler.cc:138
#3 <signal handler called>
#4 0x00007ff1b3483428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#5 0x00007ff1b348502a in __GI_abort () at abort.c:89
#6 0x000055e6ef1ae053 in PGStatService::process_pg_command (this=0x55e6fa112470, prefix="osd perf", cmdmap=std::map with 1 elements = {...}, osdmap=..., f=0x0,
ss=0x7ff1acfdd9c0, odata=0x7ff1acfdcb80) at /home/ceph/ceph/src/mon/PGStatService.h:90
#7 0x000055e6ef2eceb1 in OSDMonitor::preprocess_command (this=0x55e6fa64a000, op=...) at /home/ceph/ceph/src/mon/OSDMonitor.cc:3933
#8 0x000055e6ef2cee12 in OSDMonitor::preprocess_query (this=0x55e6fa64a000, op=...) at /home/ceph/ceph/src/mon/OSDMonitor.cc:1450
#9 0x000055e6ef2b92e8 in PaxosService::dispatch (this=0x55e6fa64a000, op=...) at /home/ceph/ceph/src/mon/PaxosService.cc:74
#10 0x000055e6ef07ed99 in Monitor::handle_command (this=0x55e6fa172800, op=...) at /home/ceph/ceph/src/mon/Monitor.cc:3179
#11 0x000055e6ef08b40d in Monitor::dispatch_op (this=0x55e6fa172800, op=...) at /home/ceph/ceph/src/mon/Monitor.cc:4276
#12 0x000055e6ef08abad in Monitor::_ms_dispatch (this=0x55e6fa172800, m=0x55e6fa19af40) at /home/ceph/ceph/src/mon/Monitor.cc:4171
#13 0x000055e6ef0c7004 in Monitor::ms_dispatch (this=0x55e6fa172800, m=0x55e6fa19af40) at /home/ceph/ceph/src/mon/Monitor.h:899
#14 0x000055e6ef8c6a17 in Messenger::ms_deliver_dispatch (this=0x55e6fa554800, m=0x55e6fa19af40) at /home/ceph/ceph/src/msg/Messenger.h:625
#15 0x000055e6ef8c59ee in DispatchQueue::entry (this=0x55e6fa554980) at /home/ceph/ceph/src/msg/DispatchQueue.cc:197
#16 0x000055e6ef5c5f70 in DispatchQueue::DispatchThread::entry (this=0x55e6fa554b28) at /home/ceph/ceph/src/msg/DispatchQueue.h:101
#17 0x000055e6ef6fc58f in Thread::entry_wrapper (this=0x55e6fa554b28) at /home/ceph/ceph/src/common/Thread.cc:79
#18 0x000055e6ef6fc4c4 in Thread::_entry_func (arg=0x55e6fa554b28) at /home/ceph/ceph/src/common/Thread.cc:59
#19 0x00007ff1b4d2b6ba in start_thread (arg=0x7ff1acfe2700) at pthread_create.c:333
#20 0x00007ff1b35553dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Actions #7

Updated by linghucong linghucong over 6 years ago

virtual int process_pg_command(const string& prefix, | |85 const map<string,cmd_vartype>& cmdmap, | |86 const OSDMap& osdmap, | |87 Formatter *f, | |88 stringstream *ss, | |89 bufferlist *odata) const { |
B+>|90 ceph_abort(); | |91 }

Actions #8

Updated by linghucong linghucong over 6 years ago

linghucong linghucong wrote:

virtual int process_pg_command(const string& prefix, | |85 const map<string,cmd_vartype>& cmdmap, | |86 const OSDMap& osdmap, | |87 Formatter *f, | |88 stringstream *ss, | |89 bufferlist *odata) const { |
B+>|90 ceph_abort(); | |91 }

why the code come here? it is amazing!

Actions #9

Updated by linghucong linghucong over 6 years ago

it look like the pgservice shoule be the sub class but it is the base class. haha!

Actions #10

Updated by linghucong linghucong over 6 years ago

linghucong linghucong wrote:

it look like the pgservice shoule be the sub class but it is the base class. haha!

else if (prefix "osd perf" ||
prefix "osd blocked-by") {
r = mon->pgservice->process_pg_command(prefix, cmdmap,
osdmap, f.get(), &ss, &rdata);

Actions #11

Updated by linghucong linghucong over 6 years ago

the ceph osd perf cmd should handle the by the mgr not the mon. so the core dump here is why this cmd is handled by the mon.in my other two mon there are not this problem. it is really make me some amazing and confused.

Actions #12

Updated by linghucong linghucong over 6 years ago

this bug look like relate to the mgr. after I reboot all the three mgr. this bug can not happen again! but it can be sure it is bug for mgr. it is no doubt.

Actions #13

Updated by Joao Eduardo Luis over 6 years ago

Looks like an iteration of http://tracker.ceph.com/issues/21300

Actions #14

Updated by Joao Eduardo Luis over 6 years ago

Please try the luminous branch, which will eventually become v12.2.2; the fix for #21300 is not included in v12.2.1.

Actions #15

Updated by Joao Eduardo Luis over 6 years ago

  • Assignee set to Joao Eduardo Luis
Actions #16

Updated by linghucong linghucong over 6 years ago

oh thank you for reply. I will try to merge that change code and rebuild it. I will try to verification it.

Actions #17

Updated by linghucong linghucong over 6 years ago

look like the code have change a lot. i will wait the v12.2.2 release to verification it.

Actions #18

Updated by linghucong linghucong over 6 years ago

look like that 21300 pr can not fix this just from the code. because i have see the log in mon.

look like it is a diffrent problem. I also found a bug accidental when i repeat reboot the mgr in ceph cluster.

some of the pg become unknown with ceph -s. But i do not catch it.

2017-10-26 20:36:08.781453 7f8e4a2fef00 15 mon.node-1151@-1(probing).log v43405 update_from_paxos logging for 0 channels
2017-10-26 20:36:08.781465 7f8e4a2fef00 10 mon.node-1151@-1(probing).log v43405 check_subs
2017-10-26 20:36:08.781616 7f8e4a2fef00 1 mon.node-1151@-1(probing).paxosservice(auth 501..545) refresh upgraded, format 0 -> 2
2017-10-26 20:36:08.781628 7f8e4a2fef00 10 mon.node-1151@-1(probing).auth v545 update_from_paxos
2017-10-26 20:36:08.781668 7f8e4a2fef00 10 mon.node-1151@-1(probing).auth v545 update_from_paxos version 545 keys ver 0 latest 541
2017-10-26 20:36:08.781729 7f8e4a2fef00 7 mon.node-1151@-1(probing).auth v545 update_from_paxos loading summary e 541
2017-10-26 20:36:08.781739 7f8e4a2fef00 7 mon.node-1151@-1(probing).auth v545 update_from_paxos latest length 2636
2017-10-26 20:36:08.782706 7f8e4a2fef00 10 mon.node-1151@-1(probing).auth v545 update_from_paxos key server version 541
2017-10-26 20:36:08.783420 7f8e4a2fef00 10 mon.node-1151@-1(probing).auth v545 update_from_paxos() last_allocated_id=1374096 max_global_id=1374096 format_version 2
2017-10-26 20:36:08.783518 7f8e4a2fef00 4 mon.node-1151@-1(probing).mgr e0 loading version 10803
2017-10-26 20:36:08.783626 7f8e4a2fef00 4 mon.node-1151@-1(probing).mgr e10803 active server: 10.11.1.150:6802/114872(394134)
2017-10-26 20:36:08.783727 7f8e4a2fef00 4 mon.node-1151@-1(probing).mgr e10803 mkfs or daemon transitioned to available, loading commands
2017-10-26 20:36:08.783760 7f8e4a2fef00 -1 mon.node-1151@-1(probing).mgr e10803 Failed to load mgr commands: (2) No such file or directory

Actions #19

Updated by linghucong linghucong over 6 years ago

Hi Joao I have merge your change code pr. but it also core dump. The error msg as below maybe help to you.

this only happen in the second mon.like below node-1151. the node-1150 and node-1152 are all ok.

root@node-1151:/usr/bin# ceph -s
cluster:
id: 3edc30f3-2157-4251-b94c-2a81db839bc8
health: HEALTH_WARN
too many PGs per OSD (320 > max 300)

services:
mon: 3 daemons, quorum node-1150,node-1151,node-1152
mgr: node-1150(active), standbys: node-1151, node-1152
osd: 3 osds: 3 up, 3 in
data:
pools: 5 pools, 320 pgs
objects: 16605 objects, 95875 MB
usage: 287 GB used, 2509 GB / 2797 GB avail
pgs: 320 active+clean

root@node-1151:/usr/bin# ceph-mon -i node-1151
2017-10-27 10:22:41.806705 7f7d2d7d7f00 -1 mon.node-1151@-1(probing).mgr e10827 Failed to load mgr commands: (2) No such file or directory

Actions #20

Updated by linghucong linghucong over 6 years ago

I have fix it!HA HA!

Actions #22

Updated by Joao Eduardo Luis over 6 years ago

Noted. I will need to go through the code and attempt to reproduce this over the weekend or first thing on monday.

Actions #23

Updated by Joao Eduardo Luis over 6 years ago

  • Status changed from Need More Info to Fix Under Review
Actions #24

Updated by Kefu Chai over 6 years ago

  • Is duplicate of Bug #21527: "mgr_command_descs" not sync in the new join Mon added
Actions #25

Updated by Kefu Chai over 6 years ago

  • Is duplicate of deleted (Bug #21527: "mgr_command_descs" not sync in the new join Mon)
Actions #26

Updated by Kefu Chai over 6 years ago

  • Related to Bug #21527: "mgr_command_descs" not sync in the new join Mon added
Actions #27

Updated by Kefu Chai over 6 years ago

  • Status changed from Fix Under Review to New

changing the status to "New", as the reporter replied over github

Hi, I used the master code to build pkg and install it. it do not coredump when ceph osd perf , but i find a new bug, in the second mon if use ceph -s will hung and not return. i will closed this and open a new bug issuue.

see https://github.com/ceph/ceph/pull/18580#issuecomment-340733826

and filed a new issue at #21986

Actions #28

Updated by Kefu Chai over 6 years ago

  • Related to Bug #21986: ceph the second mon can not join the quorum added
Actions #29

Updated by Paul Emmerich over 6 years ago

I can confirm this bug and reproduce it somewhat reliably:

  1. create a new cluster
  2. create one mon and one mgr, do not restart them!
  3. create a few OSDs and at least one pool (some IO operations on the pool might be neccessary, not sure)
  4. create a new mon/mgr
  5. run ceph osd perf a few times
  6. the new mon crashes

This bug only seems to happen with new clusters and it doesn't happen in every setup. It can be fixed by restarting all mons that are not crashing and all mgrs at the same time.

I also recently noticed that the monitoring key that tried to run these commands was lacking the mgr permissions, so it shouldn't succeed anyways. This may or may not be related, I didn't have time to test this yet (the permissions are correct in dev builds where this problem seems to be rarer)

We (croit) have a Vagrant demo setup that often triggers this when following our setup instructions including the optional step with the new mons: https://github.com/croit/vagrant-demo
Note that we'll deploy a work-around to not run "osd perf" as part of our monitoring this weekend (it's not a useful metric anyways we currently don't even use the resulting values anywhere...). This means if you want to reproduce it with our vagrant setup you'll have to run osd perf manually to trigger it.

I can also provide access to a test cluster that is currently experiencing this problem if necessary for further debugging. I've a attached full debug = 20/20 log file of a crashing mon.

Actions #30

Updated by Joao Eduardo Luis over 6 years ago

Thanks Paul. Looking into it this afternoon.

Actions #31

Updated by Joao Eduardo Luis over 6 years ago

Paul, I was able to reliably reproduce this in v12.2.1, but completely unable to do so when running a version with the monitor patches that have been mentioned in this ticket.

Could you please try it on your side with the patches available from the following branch?

https://github.com/jecluis/ceph/tree/wip-mon-fixes-for-v12.2.1

(All these patches are available on the luminous branch, and will be part of v12.2.2)

Thanks!

Actions #32

Updated by Joao Eduardo Luis over 6 years ago

  • Status changed from New to 4
Actions #33

Updated by Paul Emmerich over 6 years ago

can confirm, 12.2.2 fixes this, thanks :)

Actions #34

Updated by Joao Eduardo Luis over 5 years ago

  • Status changed from 4 to Resolved
Actions

Also available in: Atom PDF