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>
configure: don't check for arpa/nameser_compat.h twice

Nuke redundant check and move the real one into the common
AC_CHECK_HEADERS stanza.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
configure: fix F_SETPIPE_SZ detection

Currently CEPH_HAVE_SETPIPE_SZ is not set even if F_SETPIPE_SZ is
available, because AC_COMPILE_IFELSE test program as written always
fails to compile.  F_SETPIPE_SZ is a macro, so use AC_EGREP_CPP which
works on the preprocessor output instead of trying to compile.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
common/buffer: fix build breakage for CEPH_HAVE_SETPIPE_SZ

common/buffer.cc fails to build if CEPH_HAVE_SETPIPE_SZ is defined.
Fix it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Merge remote-tracking branch 'gh/next'
use partx for red hat or centos instead of partprobe

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
alert the user about error messages from partx

Signed-off-by: Alfredo Deza <alfredo@deza.pe>
Objecter: implement mon and osd operation timeouts

This captures almost all operations from librados other than mon_commands().

Get the values for the timeouts from the Objecter constructor, so only
librados uses them.

Add C_Cancel_*_Op, finish_*_op(), and *_op_cancel() for each type of
operation, to mirror those for Op. Create a callback and schedule it
in the existing timer thread if the timeouts are specified.

Fixes: #6507
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
MonClient: add a timeout on commands for librados

Just use the conf option directly, since librados is the only caller.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
msg/Pipe: add option to restrict delay injection to specific msg type

This makes it possible to test timeouts reliably by delaying certain
messages effectively forever, but still being able to e.g. connect and
authenticate to the monitors.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
librados: check and return on error so timeouts work

Some functions could not previously return errors, but they had an
int return value, which can now receive ETIMEDOUT.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
rados: check return values for commands that can now fail

A few places were not checking the return values of commands, since
they could not fail before timeouts were added.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
qa: add script for testing rados client timeout options

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #1204 from ceph/wip-fsetpipesz-fix

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge pull request #1205 from ceph/wip-7334

use `partx` for CentOS/RHEL instead of `partprobe`
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Merge branch wip-librados-timeout

Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Loic Dachary <loic@dachary.org>
doc: highlight that "raw" is the only useful RBD format for QEMU

Explain why people should be using the "raw" image format for RBD
volumes created for use by QEMU: using any other format adds only
overhead, but no extra value (since RBDs are also CoW and
thin-provisioned), plus the Qcow2 storage driver is not migration safe
when caching is enabled, whereas the RBD driver is.

Also, fix a minor glitch in the example qemu-img commands ("-f rbd"
and "-O rbd" should really be "-f raw" and "-O raw").

Finally, drop the "-f" option altogether on qemu-img commands where it
makes no sense (info and resize).

Signed-off-by: Florian Haas <florian@hastexo.com>
Merge pull request #1209 from fghaas/master

doc: highlight that "raw" is the only useful RBD format for QEMU
Merge pull request #1198 from dachary/wip-mailmap

mailmap updates

Reviewed-By: Christophe Courtaut <christophe.courtaut@gmail.com>