doc: Updated terminology. Added librados intro to index.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added librados introduction doc. Still wip.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Modified doc examples to use rados_create2.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added python example of handle, and closing session examples.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
conf: add options for librados timeouts

These will be implemented in subsequent patches.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librados: add timeout to wait_for_osdmap()

This is used by several pool operations independent of the objecter,
including rados_ioctx_create() to look up the pool id in the first
osdmap.

Unfortunately we can't just rely on WaitInterval returning ETIMEDOUT,
since it may also get interrupted by a signal, so we can't avoid
keeping track of time explicitly here.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Some suggested changes, both errors and rewordings

Python and C code examples tweaked a bit

Signed-off-by: Dan Mick <dan.mick@inktank.com>
doc: Adds Python to index and sets maxdepth to 2.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added inline literal tag.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
doc: Added Python doc.

Signed-off-by: John Wilkins <john.wilkins@inktank.com>
Rename test/filestore to test/objectstore

Now ObjectStore support three backend types, so we need to make each backend
share unit test to avoid duplicate codes.

This patch mainly make workload_generator workable for objectstore.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
mailmap: Ray Lv is with Yahoo!

Reviewed-by: Ray Lv <xiangyulv@gmail.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Yan, Zheng name normalization

Signed-off-by: Loic Dachary <loic@dachary.org>
mailmap: Somnath Roy is with SanDisk

Signed-off-by: Loic Dachary <loic@dachary.org>
crushtool: add cli test for off-by-one tries vs retries bug

See bug #7370.  This passes on dumpling and breaks prior to the #7370 fix.

Backport: emperor, dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
crush: fix off-by-one errors in total_tries refactor

Back in 27f4d1f6bc32c2ed7b2c5080cbd58b14df622607 we refactored the CRUSH
code to allow adjustment of the retry counts on a per-pool basis.  That
commit had an off-by-one bug: the previous "tries" counter was a *retry*
count, not a *try* count, but the new code was passing in 1 meaning
there should be no retries.

Fix the ftotal vs tries comparison to use < instead of <= to fix the
problem.  Note that the original code used <= here, which means the
global "choose_total_tries" tunable is actually counting retries.
Compensate for that by adding 1 in crush_do_rule when we pull the tunable
into the local variable.

This was noticed looking at output from a user provided osdmap.
Unfortunately the map doesn't illustrate the change in mapping behavior
and I haven't managed to construct one yet that does.  Inspection of the
crush debug output now aligns with prior versions, though.

Signed-off-by: Sage Weil <sage@inktank.com>
crush: allow crush rules to set (re)tries counts to 0

These two fields are misnomers; they are *retry* counts.

Signed-off-by: Sage Weil <sage@inktank.com>
crush: add chooseleaf_vary_r tunable

The current crush_choose_firstn code will re-use the same 'r' value for
the recursive call.  That means that if we are hitting a collision or
rejection for some reason (say, an OSD that is marked out) and need to
retry, we will keep making the same (bad) choice in that recursive
selection.

Introduce a tunable that fixes that behavior by incorporating the parent
'r' value into the recursive starting point, so that a different path
will be taken in subsequent placement attempts.

Note that this was done from the get-go for the new crush_choose_indep
algorithm.

This was exposed by a user who was seeing PGs stuck in active+remapped
after reweight-by-utilization because the up set mapped to a single OSD.

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

crush: fix tries/retries bug that was recently introduced

Reviewed-by: Loic Dachary <loic@dachary.org>
ceph_test_rados_api_tier: try harder to trigger the flush vs try-flush race

It seems to be reasonable easy to complete a flush before the next client
request is processed.  Crazy...

Same with the flush vs write race.

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