]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
OSD: create a helper for handling OSDMap subscriptions, and clean them up
authorGreg Farnum <greg@inktank.com>
Tue, 11 Feb 2014 21:34:39 +0000 (13:34 -0800)
committerGreg Farnum <greg@inktank.com>
Sat, 15 Feb 2014 00:54:43 +0000 (16:54 -0800)
commit6db3ae851d1c936de045390d18b1c6ae95f2a209
treefd3db640d334453259ce0b9f290c12b9fdf6c9fc
parent5b9c187caf6f7847aaa4a1003d200158dd32bf63
OSD: create a helper for handling OSDMap subscriptions, and clean them up

We've had some trouble with not clearing out subscription requests and
overloading the monitors (though only because of other bugs). Write a
helper for handling subscription requests that we can use to centralize
safety logic. Clear out the subscription whenever we get a map that covers
it; if there are more maps available than we received, we will issue another
subscription request based on "m->newest_map" at the end of handle_osd_map().

Notice that the helper will no longer request old maps which we already have,
and that unless forced it will not dispatch multiple subscribe requests
to a single monitor.
Skipping old maps is safe:
1) we only trim old maps when the monitor tells us to,
2) we do not send messages to our peers until we have updated our maps
from the monitor.
That means only old and broken OSDs will send us messages based on maps
in our past, and we can (and should) ignore any directives from them anyway.

Signed-off-by: Greg Farnum <greg@inktank.com>
src/osd/OSD.cc
src/osd/OSD.h