documentation: tiering typo

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
documentation: fix bugous osd stop/start example

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
documentation: fix bugous osd stop/start example

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

Crush: Changed Crush mapper temporary buffer length

Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash. Hence
temporary buffer is allocated to max_size parameter that specifies
the maximum osds that can be selected using the rule.

Fixes: #9492

Signed-off-by: Johnu George <johnugeo@cisco.com>
client: introduce a new flag indicating if dentries in directory are sorted

When creating a file, Client::insert_dentry_inode() set the dentry's offset
based on directory's max offset. The offset does not reflect the real
postion of the dentry in directory. Later readdir reply from real postion
of the dentry in directory. Later readdir reply from MDS may change the
dentry's position/offset. This inconsistency can cause missing/duplicate
entries in readdir result if readdir is partly satisfied by dcache_readdir().

The fix is introduce a new flag indicating if dentries in directory are
sorted. We use _readdir_cache_cb() to handle readdir only when the flag is
set, clear the flag after creating/deleting/renaming file.

Fixes: #9178
Signed-off-by: Yan, Zheng <zyan@redhat.com>
client: preserve ordering of readdir result in cache

Preserve ordering of readdir result in a list, so that the result of cached
readdir is consistant with uncached readdir.

As a side effect, this commit also removes the code that removes stale dentries.
This is OK because stale dentries does not have valid lease, they will be
filter out by the shared gen check in Client::_readdir_cache_cb()

Signed-off-by: Yan, Zheng <zyan@redhat.com>
osd: Cleanup boost optionals

Signed-off-by: William A. Kennington III <william@wkennington.com>
documentation: revise placement group number guide

When a cluster has few OSDs (less than 50) propose a preselection of
values: as long as the number of placement groups is not too small nor
too large, it won't make much of a difference anyway.

Users of small clusters tend to blindly apply the (OSD*100)/(pool size)
formula and worry about chosing a wrong value because they do not
understand the tradeoffs. The preselection will hopefully save them from
this uncertainty.

Add an explanation of how placement groups relate to OSDs, CRUSH and
pools to help understand the tradeoffs. Explain the
tradeoffs (durability, distribution and resource usages) with examples.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
Reviewed-by: Gerben Meijer <infernix@gmail.com>
Reviewed-by: Laurent Guerby <laurent@guerby.net>
tests: qa/workunits/cephtool/test.sh ! and -e

From the bash man page:

   set -e exit immediately ... The shell does not exit ... if the
   command's return value is being inverted with !

Add an explicit exit 1 where appropriate.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
tests: check osd health in cephtool/test.sh

Add a trivial osd health test at the beginning of each group of
tests. When facing an intermittent failure, it is difficult to diagnose
if the cluster appears to be missing an OSD but there is no indication
as to when the OSDs were last up.

The tests are now only run after all OSDs are up.

These checks can be disabled with --no-sanity-check to allow running
some tests that have less requirements than running all the tests.

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

Revert "Crush: Changed Crush mapper temporary buffer length"

This reverts commit 78172a665a739bd130eebb471f6299a3f424a8ca.
crush: Ensuring at most num-rep osds are selected

Crush temporary buffers are allocated as per replica size configured
by the user.When there are more final osds (to be selected as per
rule) than the replicas, buffer overlaps and it causes crash.Now, it
ensures that at most num-rep osds are selected even if more number of
osds are allowed by the rule.

Fixes: #9492

Signed-off-by: Johnu George <johnugeo@cisco.com>