osd: add a separate messenger for the Objecter

We will give the OSD's Objecter its own messenger so that it does not
interfere with the OSD when it marks things up or down.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add an Objecter instance

It gets its own lock, timer, and osdmap.

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: only request map on startup if epoch == 0

Normal clients have no map and need one to get started.  If we are the
OSD, we will already have one and will get fed maps as they come in.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: feed OSDMaps to the Objecter

Feed every map message we see (that isn't discarded for some other
reason) to the Objecter.  It has the same continuity requirements that
the OSD has, so it should be satisfied with what we get.  It can also
request maps via our MonClient.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: less whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
ceph-osd: rename msgr vars

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: allow ops to be canceled

This is useful in general, and specifically will be useful for the
rados COPY operation.

Signed-off-by: Sage Weil <sage@inktank.com>
os/ObjectStore: add bufferlist variant of setattrs

And hopefully we can kill the bufferptr ones someday!

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: add whitespace

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add COPYFROM rados op define

This operation will copy an entire object (data, attrs, omap)
atomically.  If the src_version does not match the source object, or
the source object is updated while the copy is in progress, we will
fail with a suitable error code.  By atomic we mean that it will either
successfully copy the entire object in its entirety or it will fail (and
require no cleanup).

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: add copyfrom() op

Signed-off-by: Sage Weil <sage@inktank.com>
librados: add copyfrom() operation to C++ API

Only usable via the ObjectWriteOperation API for now.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: wire Objecter up to its messenger

Feed the Objecter connect and reset events as well as any messages that
come in on its messenger.  That should only be MOSDOp and MOSDOpReply
at this point, since the MonClient is shared with the OSD.

Signed-off-by: Sage Weil <sage@inktank.com>
osd: give the objecter a client.* id

This side-steps the various checks in the OSD that "do X if this is an
OSD".

Signed-off-by: Sage Weil <sage@inktank.com>
osd: add objecter_finisher

The Objecter does completions synchronously, but that will run under
the objecter_lock.  We'll want to nest that inside the PG lock to queue
new IOs, which means the completions will need to run async so that
they can retake the pg lock safely.

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: add COPYSOME operation

Copy some amount of data from a source object.  Includes data, attr, and
omap content.  Caller provides some offset describing what they already
have (a data offset and last omap key) and we return up to max bytes of
whatever is left.

On completion, return 0.  If more data is coming, return 1.

Signed-off-by: Sage Weil <sage@inktank.com>
wip copyfrom