Add header cache to DBObjectMap

OMap is used by PG to store PGLog, so it's called by each write operations.
Because leveldb don't play well in random read and "header_lock" limit the
concurrence. Add a LRU cache to avoid too much overload on seeking header.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
osd: skip out of order op checks on tiered pools

When we send redirected ops, we do not assign a new tid, which means that
a given client's ops for a pool may not have strictly ordered tids.  Skip
this check if the pool is tiered to avoid false positives.

Fixes: #8380
Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: flag ops that have been redirected

In the future it may be helpful to know whether an op has been redirected
by the OSD.

We don't need it bad enough now to spend a feature bit to know whether this
flag is reliably set.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1825 from ceph/wip-8380

osd: skip out of order op checks on tiered pools

Reviewed-by: Samuel Just <sam.just@inktank.com>
Fix set_alloc_hint op cause KeyValueStore crash problem

Now KeyValueStore doesn't support set_alloc_hit op, the implementation of
_do_transaction need to consider decoding the arguments. Otherwise, the
arguments will be regarded as the next op.

Fix the same problem for MemStore.

Fix #8381

Reported-by: Xinxin Shu <xinxin.shu5040@gmail.com>
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
ceph-disk: Enable creating multiple osds per dev

This is useful for demos and testing.  Enables
creation of lots of OSDs on a single block device
by simply running ceph-disk prepare more than once,
with a --data-size argument set.

Signed-off-by: John Spray <john.spray@inktank.com>
osd: fix map advance limit to handle map gaps

The recent change in cf25bdf6b0090379903981fe8cee5ea75efd7ba0 would stop
advancing after some number of epochs, but did not take into consideration
the possibilty that there are missing maps.  In that case, it is impossible
to advance past the gap.

Fix this by increasing the max epoch as we go so that we can always get
beyond the gap.

Signed-off-by: Sage Weil <sage@inktank.com>
pybind/rados: Fix timeouts for small t

Previously, if passing a number less than 0.5 for
the timeout, operations would always return
a failure status code.

The same problem would also generate premature timeouts
for operations which completed within 0.5s of
their timeout deadline.

Fix the logic so that we only decrement `countdown`
if the thread has not completed when returning from join().

Signed-off-by: John Spray <john.spray@inktank.com>
better error reporting on incompatible device requirements

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
crush: add adjust_subtree_weight()

Adjust the weight for all (leaf) items beneath a subtree.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/OSDMonitor: add 'osd crush reweight-subtree ...'

Reweight all items within a subtree.  For example, you might reweigh tall
OSDs within a rack to a new value.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/OSDMonitor: simplify 'osd crush reweight ...' flow

Use the goto labels; drop the do/while.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1878 from ceph/wip-map-advance

osd: fix map advance limit to handle map gaps

Reviewed-by: Samuel Just <sam.just@inktank.com>
doc: removed Apex Sans font, replace with font from GFE

Signed-off-by: Ross Turk <rturk@redhat.com>
doc: alter doc CSS for the removal of Apex Sans

Signed-off-by: Ross Turk <rturk@redhat.com>
osd: fix bad is_active() assert in share_map()

We may be is_stopping() here if we are racing with shutdown().

Fixes: #8465
Backport: firefly, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #1874 from ceph/wip-8292

better error reporting on incompatible device requirements

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Merge pull request #1840 from yuyuyu101/wip-8381

Fix set_alloc_hint op cause KeyValueStore crash problem

Reviewed-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1882 from ceph/wip-8465

osd: fix bad is_active() assert in share_map()

Reviewed-by: Samuel Just <sam.just@inktank.com>
common: WRITE_{EQ,CMP}_OPERATORS_1

For when a struct is defined to encapsulate a single value and get
control over implicit conversions that would otherwise be impossible
with typedef.

Signed-off-by: Loic Dachary <loic@dachary.org>