ceph got slow request because of primary osd drop messages

Bug #1798081 reported by dongdong tao
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ceph (Ubuntu)
Fix Released
High
Unassigned
Trusty
Fix Released
High
dongdong tao

Bug Description

[Impact]
Ceph from ubuntu trusty, the version is 0.80.*.
The bug is that when a message seq number has exceeds the max value of unsigned 32 bit which is 4294967295, the unsigned 64 bit seq number will be truncated to unsigned 32 bit. But the seq number is supposed to increase one by one, and if messenger got a message which has an old seq number, it will just drop it.

when it dropped one sub_op/sub_op reply message, then this operation will not be able to succeed, it will become a slow request.
cluster will suffering from slow requests when it hits this bug.
when it drops other message, might lead to other bad situation ( like droping osd_ping message might cause the osd down).

[Test case]
Deploy a trusty ceph cluster
Two ways to reproduce, A will take at least 2 months to reproduce, B will be much easier:
A.
1. ceph daemon osd.<id> set config debug_ms 10
2. wait for the seq number to increasing to max value of unsigned 32 bit value which is 4294967295, we can get the current seq number by doing
command "grep "reader got message" /var/log/ceph/ceph-osd/ceph-osd.id.log"
3. you will finally see the messenger will drop message and see below log
"reader got old message 0 <= 4294967295 0x7fa6854a3e00 osd_sub_op_reply(client.125216.1:7850657018 3.dc e24410dc/rb.0.103e.238e1f29.000000000027/head//3 [] ondisk, result = 0) v2, discarding "

B.
1. ceph daemon osd.<id> set config debug_ms 10
2. gdb attach <pid of ceph-osd>
3. set a breakpoint at function Pipe::writer and set a command "set out_seq=4294967295" to this breakpoint
4. continue the process, when it hit the breakpoint multiple times (osd number - 1), we can exit the gdb.
5. grep other osds log and see if you can find message dropping log like :
"reader got old message 0 <= 4294967295 0x7fa6854a3e00 osd_sub_op_reply(client.125216.1:7850657018 3.dc e24410dc/rb.0.103e.238e1f29.000000000027/head//3 [] ondisk, result = 0) v2, discarding "

[Regression Potential]
After this patch is applied, When we upgrade to a higher version which does not contain this patch, if the seq number has already exceeded 4294967295. it might drop messages very quickly

[Original Bug Report]
When in_seq is 0xffffffff, Pipe::reader expects the incoming message's sequence to be 0x100000000. But m->get_seq() return 0. So the incoming message gets dropped.
https://tracker.ceph.com/issues/16122

dongdong tao (taodd)
description: updated
description: updated
Revision history for this message
dongdong tao (taodd) wrote :

This is the debdiff file

Revision history for this message
dongdong tao (taodd) wrote :
tags: added: sts-sru-needed
tags: added: sts
dongdong tao (taodd)
description: updated
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp1798081_trusty.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
dongdong tao (taodd) wrote :
dongdong tao (taodd)
description: updated
Revision history for this message
James Page (james-page) wrote :

Uploaded to trusty proposed for SRU team review.

Changed in ceph (Ubuntu):
status: New → Triaged
importance: Undecided → High
Changed in ceph (Ubuntu Trusty):
status: New → Triaged
importance: Undecided → High
Changed in ceph (Ubuntu):
status: Triaged → Fix Released
Changed in ceph (Ubuntu Trusty):
assignee: nobody → dongdong tao (taodd)
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote :

Is this fixed in the development release of Ubuntu? If so when did the fix become available and are any releases besides Trusty affected?

Changed in ceph (Ubuntu Trusty):
status: In Progress → Incomplete
Revision history for this message
dongdong tao (taodd) wrote :

Xenial has Jewel ceph, Jewel have that patch.
so this issue does not affect Xenial ubuntu or releases later then Xenial.

Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello dongdong, or anyone else affected,

Accepted ceph into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ceph/0.80.11-0ubuntu1.14.04.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-trusty to verification-done-trusty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-trusty. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ceph (Ubuntu Trusty):
status: Incomplete → Fix Committed
tags: added: verification-needed verification-needed-trusty
Revision history for this message
dongdong tao (taodd) wrote :

Hi Brian,

I have verified trusty-proposed, it works good!
I used the second method (the gdb one) to verify it, below is the message I got:
231007:2018-12-04 13:54:53.828152 7ffa7658b700 10 -- 10.5.0.13:6801/15728 >> 10.5.0.20:6802/1017937 pipe(0x7ffa96c8a280 sd=146 :6801 s=2 pgs=3 cs=1 l=0 c=0x7ffa96f592e0).reader got message 4294967607 0x7ffa96c8ca80 osd_sub_op_reply(client.14165.0:26 2.36 b27bf2f6/benchmark_data_juju-13c929-ceph-trusty-0_21644_object25/head//2 [] ondisk, result = 0) v2

so we can see the osd_sub_op_reply was not been dropped even the message seq number has exceed the max value of unsigned 32 bit.

Thanks,
Dongdong

tags: added: verification-done-trusty
removed: verification-needed-trusty
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for ceph has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ceph - 0.80.11-0ubuntu1.14.04.4

---------------
ceph (0.80.11-0ubuntu1.14.04.4) trusty; urgency=medium

  * Don't truncate message sequence to 32-bit (LP: #1798081).
    - d/p/msg-don-t-truncate-message-sequence-to-32-bits.patch:
      use uint64_t for message seq instead of 32 bits.

 -- dongdong tao <email address hidden> Mon, 12 Nov 2018 15:01:00 +0800

Changed in ceph (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.