ceph_mon: check for existing mon store before opening db

This will make sure that the monitor data directory is populated before
proceeding to opening it up.  We have to do this in order to work around
leveldb, which will create 'store.db' (even though it won't populate it)
upon opening the database.  Unwillingly, running the monitor without
first issuing a mkfs would have us ending up with a 'store.db' in the
monitor's data directory, and later on we would get errors from the
monitor not finding magic values within the store -- which given mkfs
hadn't been run isn't surprising.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
mon: fix occasional message leak after session reset

Consider:

 - we get a message, put it on a wait list
 - the client session resets
 - we go back to process the message later and discard
   - _ms_dispatch returns false, but nobody drops the msg ref

Since we call _ms_dispatch() a lot internally, we need to always return
true when we are an internal caller.

Fixes: #9176
Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@redhat.com>
mon: always process the message in dispatch

Nobody should be chained after teh mon, so we can safely drop any message
we don't understand.

Signed-off-by: Sage Weil <sage@redhat.com>
mon: make dispatch(), _ms_dispatch() void

They always return true.

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #2301 from ceph/wip-9176

mon: fix occasional memory leak; clean up dispatch return codes

Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
needs network or it will not start if enabled

example error message: "unable to find any IP address in networks: 10.2.27.0/25", so the service wont start
mds: set l_mds_req on client request

This is one input for the load balancer.

Signed-off-by: Sage Weil <sage@redhat.com>
mds: rename a bunch of metrics

Also clean out a few that were unused and some dead code.

Signed-off-by: Sage Weil <sage@redhat.com>
mds/Server: rename perfcounters

Signed-off-by: Sage Weil <sage@redhat.com>
common: remove spurious uint32_t in buffer.c

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
rgw: admin ops create user API can not determine existing user

Fixes: #8583

Signed-off-by: Ray Lv <raylv@yahoo-inc.com>
CollectionIndex: Collection name is added to the access_lock name

The CollectionIndex constructor is changed to accept the coll_t
so that the collection name can be used to form access_lock(RWLock)
name.This is needed otherwise lockdep will report a recursive lock error
and assert. lockdep needs unique lock names for each Index object.

Fixes: #9145

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
(cherry picked from commit 615d2d904024526cc58557ee5250c2536a3cd5c8)
ceph_test_rados_api_tier: make PromoteOn2ndRead test tolerate retries

If there is an ill-timed connection reset our read could get sent twice.
Weaken our assertion if the read was slow to tolerate this case.

Fixes: #9221
Signed-off-by: Sage Weil <sage@redhat.com>
rgw: fix test to identify whether object has tail

Fixes: #9226
Reported-by: Sylvain Munaut <s.munaut@whatever-company.com>
Backport: firefly

We need to identify whether an object is just composed of a head, or
also has a tail. Test for pre-firefly objects ("explicit objs") was
broken as it was just looking at the number of explicit objs in the
manifest. However, this is insufficient, as we might have empty head,
and in this case it wouldn't appear, so we need to check whether the
sole object is actually pointing at the head.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Merge pull request #2320 from ceph/wip-9221

ceph_test_rados_api_tier: make PromoteOn2ndRead test tolerate retries

Reviewed-by: Samuel Just <sam.just@inktank.com>
fix wrong value of op_w_latency perf counter

Fixes: #9217

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
don't update op_rw_rlatency/op_w_rlatency when rlatency is zero

Signed-off-by: xinxin shu <xinxin.shu@intel.com>
vstart: start rgw on port specified by env var

This ensures that user specified option according to $CEPH_RGW_PORT is
considered before starting radosgw

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@ril.com>
Merge pull request #2327 from theanalyst/fix/vstart_rgw_port

vstart: start rgw on port specified by env var

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #2325 from xinxinsh/wip-9217

fix wrong value of op_w_latency perf counter

Reviewed-by: Sage Weil <sage@redhat.com>