osd: Improve logging output including pg_shard_t as osd#(shard)

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Add logging of missed l_osd_agent_skip cases

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Error from start_flush() not checked in agent_maybe_flush()

This caused a very minor memory leak since ctx was allocated
Include logging of l_osd_agent_skip

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: start_flush() should check for missing clones and return if requested

Fixes: #7659

Signed-off-by: David Zafman <david.zafman@inktank.com>
PG: always clear agent_state in clear_primary_state

We aren't actually active between activate() and all_activated_committed().
We'd have to suspend agent_work during that period which seems like too much
complexity for too little work saved.

Fixes: #7904
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: hit_set_setup, agent_setup, skip if !active

We call these in on_activate and on_pool_change.  In the former, we are
necessarily active.  In the latter, we only want to do anything if we are
active (otherwise, it will be taken care of when we eventually do become
active).

Fixes: #7904
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: improve get_object_context debugging

Signed-off-by: Samuel Just <sam.just@inktank.com>
debian: move ceph-rest-api from ceph-common to ceph

ceph-rest-api is a 'server' thing that runs persistently; 'ceph' is a
better match.

Signed-off-by: Sage Weil <sage@inktank.com>
debian: make ceph-common own etc/ceph, var/log/ceph

Clients can make use of these directories, and ceph-common is required by
ceph, so nothing should break here.

Change the purge postrm script to be for ceph-common (it does nothing else).

Signed-off-by: Sage Weil <sage@inktank.com>
debian: move rbdmap config and sysvinit/upstart scripts into ceph-common

Fixes: #7171
Signed-off-by: Sage Weil <sage@inktank.com>
debian: fix control to allow upgrades

Signed-off-by: Mohammad Salehe <salehe+dev@gmail.com>
ReplicatedPG::_verify_no_head_clones: missing implies that the clone exists

Fixes: #7659
Signed-off-by: Samuel Just <sam.just@inktank.com>
qa: test_alloc_hint: set ec ruleset-failure-domain to osd

Create a custom profile with ruleset-failure-domain=osd.  (The default
ruleset-failure-domain=host won't do because this script assumes and
works only if all osds are on the same host.)  While at it, set k and m
explicitly to avoid troubles in the future.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Merge pull request #1581 from ceph/wip-init

a few deb changes
Merge pull request #1598 from ceph/wip-test-alloc-hint-ec-fix

qa: test_alloc_hint: set ec ruleset-failure-domain to osd

Reviewed-by: Sage Weil <sage@inktank.com>
osd: add 'osd debug reject backfill probability' option

This will make the OSD randomly reject backfill reservation requests.  This
exercises the failure code paths but does not break overall behavior
because the primary will back off and retry later.

This should help us reproduce #7922.

Signed-off-by: Sage Weil <sage@inktank.com>
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>
ReplicatedPG: handle FLAG_OMAP on promote and copyfrom

Fixes: #7967
Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: track num_objects_omap in pg stats

Fixes: #7831
Signed-off-by: Samuel Just <sam.just@inktank.com>