1
0
mirror of https://github.com/ceph/ceph synced 2025-01-27 21:44:58 +00:00
Commit Graph

28 Commits

Author SHA1 Message Date
Adam C. Emerson
f45e480e8e messages: Use unqualified encode/decode
This is a portion of Part 1 of the namespace project: using ADL
properly in encode and decode so we can use namespaces easily in Ceph.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
2018-01-10 14:02:09 -05:00
liuchang0812
ab9f6cea59 common: add override in msg subsystem
Signed-off-by: liuchang0812 <liuchang0812@gmail.com>
2017-03-03 19:15:56 +08:00
Sage Weil
61fca96c29 assert(0) -> ceph_abort()
Signed-off-by: Sage Weil <sage@redhat.com>
2016-11-21 23:37:31 -05:00
Sage Weil
cbc3b91cef mon: mark PaxosServiceMessage forward fields deprecated
These are no longer used; we manage forward state explicitly via the
Monitor sessions instead.  Mark them deprecated so we don't accidentally
rely on them.  Also, fix the annoying "mon.-1" garbage debug output that
is confusing.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-26 10:48:49 -07:00
Sage Weil
95ed73a73b mon: drop forwarded requests after an election
On each election, we resend routed requests to the new leader (or
requeue for ourselves).  Therefore, if we receive a forwarded request,
we should drop it on the floor if there is a new election.  Add a field
in the PaxosServiceMessage struct to track which election epoch we
received the request in, and drop it in PaxosService::dispatch() if
that is in the past.

Signed-off-by: Sage Weil <sage@inktank.com>
2013-04-23 14:06:41 -07:00
Sage Weil
7b5689acfc messages: populate header.version in constructor
Define a HEAD_VERSION and COMPAT_VERSION for any versioned message.  Pass
to Message constructor so that it is always initialized, even from the
the default constructor.  That's needed because we use that to check
decoding compatibility when receiving/decoding messages.

If we are conditionally encoding an old version, explicitly set
header.version in encode_payload().

We also set compat_version to demonstrate what will happen for future
revisions.  In this case, it's moot, because no old code understands
compat_version yet: nobody with old decode code will see these values
anyway.  But use this opportunity to demonstrate how it would be used in
the future.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-02-10 14:38:13 -08:00
Sage Weil
9987f8f95c msg: go const-crazy on messages
- get_type_name()
- print()
and all the random crap they call.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-01-30 13:28:53 -08:00
Sage Weil
0e8129ad68 msg: no cct for decode_payload
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-01-30 12:28:45 -08:00
Sage Weil
11f6a840be msg: no cct needed for message encoding
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-01-30 12:03:12 -08:00
Sage Weil
79998762b5 msg: pass features explicitly into message encoders
Avoid using the connection reference; pass it in explicitly instead.  This
will make ceph-dencoder's life a bit easier.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
2012-01-30 10:34:30 -08:00
Colin Patrick McCabe
ba61191021 msg: remove globals
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
2011-06-20 16:41:42 -07:00
Markus Elfring
f4b9d9d847 Bug : Unique names for include guards
A couple of preprocessor symbols for include guards tampered with the reserved namespace.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Sage Weil <sage@newdream.net>
2010-06-17 10:47:37 -07:00
Sage Weil
edc92490b5 types: standardize on uint64_t
The problem is that on some platforms __u64 == uint64_t (x86_64), and on
others it's doesn't (ppc64).  Which means we don't know whether to define
different versions of overloaded functions for both types or just one.

So, standardize on uint64_t.  This plays nicer with STL, which defines
hash<uint64_t> on 64 bit arches but not 32 bit.  Which means we can't
standarzie on __u64 or else hash<__u64> won't work.  Bah!
2010-05-07 14:50:20 -07:00
Sage Weil
84c386ea0d mon: m->get_session() may return null if session has closed
because the session close clears connection->priv.  We need to check at
each site anyway, either for null session, or for session->closed.  So
check for null session.
2010-04-29 10:22:13 -07:00
Greg Farnum
d767c13a2a msg: PaxosServiceMessage has a protected destructor 2010-03-31 14:59:36 -07:00
Greg Farnum
cd7edcafd4 mon: Fix all uses of Session and get_caps.
They now use MonSession and get_service()->caps, respectively.
2010-03-25 11:03:11 -07:00
Greg Farnum
1045738077 msg: Add get_session function to PaxosServiceMessage 2010-03-25 11:02:21 -07:00
Greg Farnum
c69a03391d Revert "msg: PaxosServiceMessage includes a MonCap*"
This reverts commit 167b28a0d4.
2010-03-25 11:02:20 -07:00
Sage Weil
c10496040a mon: declare class MonCaps in PaxosServiceMessage 2010-03-16 11:41:50 -07:00
Greg Farnum
797ee53ab0 Revert "mon: PaxosServiceMessages now routed through paxos_dispatch and get caps set"
This reverts commit 0c688f94be.

Revert "mon: Use PaxosServiceMessage::caps instead of Session::caps where applicable"

This reverts commit e33e17ec2f.

This needs to be reworked slightly to handle inter-mon communication better.
2010-03-16 11:18:26 -07:00
Greg Farnum
0c688f94be mon: PaxosServiceMessages now routed through paxos_dispatch and get caps set 2010-03-15 17:03:38 -07:00
Greg Farnum
167b28a0d4 msg: PaxosServiceMessage includes a MonCap* 2010-03-15 15:58:52 -07:00
Sage Weil
13287e43e2 mon: fix up some uninitialized memory 2009-10-16 15:42:34 -07:00
Sage Weil
dda342696d mon: oops, make PaxosServiceMessage match ceph_mon_request_header 2009-10-12 11:38:56 -07:00
Sage Weil
abd6254199 mon: new, improved monitor request/reply routing
We track which monitor requests are forwarded to the leader in the mon
Session, and clean them out when we send a reply back via MRoute.

Only forward once, and resend pending requests on election completion.
This may lead to harmless dups, but at least we know our request didn't
get dropped on the floor by another mon failing somewhere.

This changes the monitor protocol by expanding the PaxosServiceMessage
header.
2009-10-09 16:33:15 -07:00
Greg Farnum
f16a28df95 No more VERSION_T; just 0. 2009-06-25 15:03:41 -07:00
Sage Weil
7f9d38701b mon: cleanup 2009-06-24 13:15:35 -07:00
Greg Farnum
5c39415b49 messages: Added PaxosServiceMessage to repository so previous commits work. 2009-06-24 13:06:33 -07:00