]> 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>
Tue, 25 Feb 2014 19:42:02 +0000 (11:42 -0800)
commit61b2aeee7c37e03d5f6691c08c7760c48a85a2e1
treefa69006073ea1c53c5e4bc76aa5f542175fbdd3c
parentd93d67d1a315d8abe8d1cd9d7ea83417a19e2406
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>
Reviewed-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 6db3ae851d1c936de045390d18b1c6ae95f2a209)

Conflicts:

src/osd/OSD.h
src/osd/OSD.cc
src/osd/OSD.h