Messenger V2
Hi,
By reading the old "msgr2 protocol" thread, and according to this particular response (https://marc.info/?l=ceph-devel&m=147361359132535&
w=2), I understood that the idea is to allow a daemon/client to instantiate a V2 msgr instance in a new port, while still allowing a V1 msgr instance to exist.
I'm starting to make some changes to the msgr code, and I'm planning to allow the specification of the protocol (V1 or V2) in the constructor. This allows to create two messengers instances each one using a different protocol and bonded to different ports.
Does this make sense?
Also, since we want to support multiple Ceph daemons (multiplexing) in the same process, what would be the preferable API (messenger <-> Ceph daemon) to be user:
a) Instantiate a single Messenger object and share the instance between the multiple "sub-daemons"
b) Each "sub-daemon" instantiates a Messenger object, and the internal Messenger code will take care of the magic of re-using/sharing the connections to the same peers.
The current API for using the messenger exposes the "Connection" abstraction. With the multiplexing feature, we will have "Stream"s inside each "Connection".
My question is: should we keep the same API, hence the Connection interface, and use it has actually a stream? (this has the benefit of requiring almost no changes to the current code).
Or, should we expose the Stream abstraction and rewrite the code that uses the Messenger/Connection?
Thanks,
Signature · 5 lines
Ricardo Dias Senior Software Engineer - Storage Team SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-snip-
Quoted 9 lines · Ricardo Dias
Also, since we want to support multiple Ceph daemons (multiplexing) in the same process, what would be the preferable API (messenger <-> Ceph daemon) to be user:
a) Instantiate a single Messenger object and share the instance between the multiple "sub-daemons"
b) Each "sub-daemon" instantiates a Messenger object, and the internal Messenger code will take care of the magic of re-using/sharing the connections to the same peers.
I would recommend a) here. I was imagining each sub-daemon having its own Dispatcher, with a single Messenger instance for the process that fed its Messages into a MultiplexingDispatcher that knew how to steer them to the right sub-Dispatcher.
Quoted 18 lines · Ricardo Dias
Hi,
By reading the old "msgr2 protocol" thread, and according to this particular response (https://marc.info/?l=ceph-devel&m=147361359132535&
w=2), I understood that the idea is to allow a daemon/client to instantiate a V2 msgr instance in a new port, while still allowing a V1 msgr instance to exist.I'm starting to make some changes to the msgr code, and I'm planning to allow the specification of the protocol (V1 or V2) in the constructor. This allows to create two messengers instances each one using a different protocol and bonded to different ports.
Does this make sense?Also, since we want to support multiple Ceph daemons (multiplexing) in the same process, what would be the preferable API (messenger <-> Ceph daemon) to be user:
Quoted 5 lines
a) Instantiate a single Messenger object and share the instance between the multiple "sub-daemons"
b) Each "sub-daemon" instantiates a Messenger object, and the internal Messenger code will take care of the magic of re-using/sharing the connections to the same peers.
I agree with Casey that (a) seems more attractive. It'll require a bit of reworking things, though. Right now we have like 6 Messengers used by the OSD. I have a PR that eliminates several of them (by consolidating heartbeats onto the main messengers), but enen with that we'll need 2 separate instances, one for the public network and one for the cluster network. So I suspect we'll still need some capability to have mulitple Messenger instances share some internal state.
Quoted 9 lines
The current API for using the messenger exposes the "Connection" abstraction. With the multiplexing feature, we will have "Stream"s inside each "Connection".
My question is: should we keep the same API, hence the Connection interface, and use it has actually a stream? (this has the benefit of requiring almost no changes to the current code).Or, should we expose the Stream abstraction and rewrite the code that uses the Messenger/Connection?
I think we can keep with Connection; the "stream" in the msgr2 description is meant to map directly to that.
sage
Quoted 26 lines · Sage Weil
Quoted 18 lines · Ricardo Dias
Hi,
By reading the old "msgr2 protocol" thread, and according to this particular response (https://marc.info/?l=ceph-devel&m=147361359132535&
w=2), I understood that the idea is to allow a daemon/client to instantiate a V2 msgr instance in a new port, while still allowing a V1 msgr instance to exist.I'm starting to make some changes to the msgr code, and I'm planning to allow the specification of the protocol (V1 or V2) in the constructor. This allows to create two messengers instances each one using a different protocol and bonded to different ports.
Does this make sense?Also, since we want to support multiple Ceph daemons (multiplexing) in the same process, what would be the preferable API (messenger <-> Ceph daemon) to be user:
Quoted 5 lines
a) Instantiate a single Messenger object and share the instance between the multiple "sub-daemons"
b) Each "sub-daemon" instantiates a Messenger object, and the internal Messenger code will take care of the magic of re-using/sharing the connections to the same peers.
Quoted 7 lines
I agree with Casey that (a) seems more attractive. It'll require a bit of reworking things, though. Right now we have like 6 Messengers used by the OSD. I have a PR that eliminates several of them (by consolidating heartbeats onto the main messengers), but enen with that we'll need 2 separate instances, one for the public network and one for the cluster network. So I suspect we'll still need some capability to have mulitple Messenger instances share some internal state.
Perhaps a good first step here is to finish this PR
https://github.com/ceph/ceph/pull/15067
I dropped it leading up to luminous because I was hitting some non-obvious bug and other things were higher priority. It's helpful on its own, though, and probably necessary lead-up to the multiplexing. Needs rebase and testing and review...
sage