ReplicatedPG: do not create snapdir on head eviction

Head eviction implies that no clones are present.  Also, add
an exists flag to SnapSetContext in order prevent an ssc from
a recent eviction from preventing a snap read from activating
the promotion machinery.

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::do_op: use get_object_context for list-snaps

find_object_context provides some niceties which we don't need since we know
the oid of the clones.  Problematically, it also return ENOENT if the snap
requested happens to have been removed.  Even in such a case, the clone may
well still exist for other snaps.  Rather than modify find_object_context to
avoid this situation for this caller, we'll simply do it inline in do_op.

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: disable agent when stats_invalid (post-split)

After a split the pg stats are approximate but not precisely correct.  Any
inaccuracy can be problematic for the agent because it determines the
level of effort and potentially full/blocking behavior based on that.

We could concievably do some estimation here that is "safe" in that we
don't commit to too much effort (or back off later if it isn't paying off)
and never block, but that is error-prone.

Instead, just disable the agent until a scrub makes the stats reliable
again.

We should document that a scrub after split is recommended (in any case)
and especially important on cache tiers, but there are currently *no*
user docs about PG splitting.

Fixes: #7975
Signed-off-by: Sage Weil <sage@inktank.com>
mon: MonCommands: have all 'auth' commands require 'execute' caps

Earlier patch already have the entity requiring 'execute' caps for
read-only commands.  This patch introduces the same requirement for *all*
auth commands, read-only and read-write alike.

While the rationale behind the earlier patch for leaving read-write
operations out of this requirement still holds, we now enforce this to
match compatibility with what was happening back on Dumpling with regard
to the 'execute' cap being required for auth commands.  However, it should
be noted that back on Dumpling we were only requiring the 'execute' cap
for auth commands, regardless of read-only or read-write, and no other
caps were required.

Fixes: 7919

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
qa: workunits: mon: auth_caps.sh: test 'auth' caps requirements

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ReplicatedPG::finish_promote: add debugging assert for clone_size

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::find_object_context: check obs.exists on clone obc before checking snaps

Fixes: #7858
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::_scrub: account for clone_overlap on each clone

Otherwise, we end up subtracting off clone_overlap for evicted clones
whose sizes we did not add in.

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: use get_clone_bytes on evict/promote

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::make_writeable: check for evicted clone before adjusting for clone_overlap

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::trim_object: account evicted prev clone for stats

If the previous clone is evicted, we shouldn't adjust the stats to
account for its new clone_overlap value.

Fixes: #7964
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: do not evict head while clone is being promoted

Fixes: #8003
Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/ReplicatedPG: kickstart the agent if scrub stats become valid

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: dump agent state on pg query

Signed-off-by: Sage Weil <sage@inktank.com>
osd/ReplicatedPG: warn if invalid stats prevent us from activating agent

Signed-off-by: Sage Weil <sage@inktank.com>
doc: Removed --stable arg and replaced with --release arg for ceph-deploy.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Merge pull request #1611 from ceph/wip-7975

osd: disable agent when stats_invalid (post-split)

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1620 from ceph/wip-8003

Wip 8003

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1612 from ceph/wip-7919

mon: MonCommands: have all 'auth' commands require 'execute' caps

Reviewed-by: Sage Weil <sage@inktank.com>
ceph_test_rados_api_misc: print osd_max_attr_size

Very confusing results from this test in bug #8009.

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