common/Formatter: add newline to flushed output if m_pretty

This applies to json-pretty and xml-pretty modes.

Signed-off-by: Sage Weil <sage@inktank.com>
objecter: don't resend paused ops

Paused ops are meant to block on the client side until a new map that
unpauses them is recieved. If we send paused writes when the FULL flag
is set, we'll get -ENOSPC from the osds, which is not what Objecter
users expect. This may cause rbd without caching to produce an I/O
error instead of waiting for the cluster to have capacity.

Fixes: #6725
Backport: dumpling
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
objecter: set op->paused in recalc_op_target(), resend in not paused

When going through scan_requests() in handle_osd_map() we need to make
sure that if an op should not be paused anymore then set it on the op
itself, and return NEED_RESEND. Otherwise we're going to miss reset of
the full flag.
Also in handle_osd_map(), make sure that op shouldn't be paused before
sending it. There's a lot of cleanup around that area that we should
probably be doing, make the code much more tight.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
objecter: clean pause / unpause logic

op->paused holds now whether operation should be paused or not, and it's
being updated when scanning requests. No need to do a second scan.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
doc: Added manual deployment section to index.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added a manual deployment doc.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Cleanup on Add/Remove monitor.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Cleanup of Add/Remove OSDs.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Minor updates to manual deployment document.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
OSDMonitor: return EEXIST if users try to do a PG merge

This was returning a machine-code success if users tried to merge, and
was erroneously (but harmlessly) increasing the pool's last_change
marker even though it wasn't actually changing anything.

Backport: emperor

Signed-off-by: Greg Farnum <greg@inktank.com>
OSDMonitor: prevent extreme multipliers on PG splits

Fixes: #6922
Backport: emperor

Signed-off-by: Greg Farnum <greg@inktank.com>
OSDMap: use unsigned instead of int for OSD counts

These functions can never return <0, so use unsigned.

Signed-off-by: Greg Farnum <greg@inktank.com>
OSDMonitor: use a different approach to prevent extreme multipliers on PG splits

Signed-off-by: Greg Farnum <greg@inktank.com>
doc: Partially incorporated comments from Aaron Ten Clay.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Partially incorporated comments form Loic Dachary and Aaron Ten Clay.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
FileSTore: do not time out threads while they're waiting for op throttle

In order to support this, we pass TPHandle* through the ObjectStore
interface, and then if we have one we suspend the timeouts while
waiting to get our op/byte throttles in the FileStore.
The OSD uses this when doing PG splits.

Signed-off-by: Greg Farnum <greg@inktank.com>
Merge pull request #886 from ceph/wip-6922

Fix some pg_num change return codes and make them more resistant to mis-use

Reviewed-by: Sage Weil <sage@inktank.com>
osd: drop writes when full instead of returning an error

There's a race between the client and osd with a newly marked full
osdmap.  If the client gets the new map first, it blocks writes and
everything works as expected, with no errors from the osd.

If the osd gets the map first, however, it will respond to any writes
with -ENOSPC. Clients will pass this up the stack, and not retry these
writes later.  -ENOSPC isn't handled well by all clients. RBD, for
example, may pass it on to qemu or kernel rbd which will both
interpret it as EIO.  Filesystems on top of rbd will not behave well
when they receive EIOs like this, especially if the cluster oscillates
between full and not full, so some writes succeed.

To fix this, never return ENOSPC from the osd because of a map marked
full, and rely on the client to retry all writes when the map is no
longer marked full.

Old clients talking to osds with this fix will hang instead of
propagating an error, but only if they run into this race
condition. ceph-fuse and rbd with caching enabled are not affected,
since the ObjectCacher will retry writes that return errors.

Refs: #6938
Backport: dumpling, emperor
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
objecter: resend all writes after osdmap loses the full flag

Now that the osd does not respond if it gets a map with the full flag
set first, clients need to resend all writes.

Clients talking to old osds are still subject to the race condition,
so both sides must be upgraded to avoid it.

Refs: #6938
Backport: dumpling, emperor
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rbd: check write return code during bench-write

This is allows rbd-bench to detect http://tracker.ceph.com/issues/6938
when combined with rapidly changing the mon osd full ratio.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>