SimpleMessenger: Retry binding on addresses if binding fails

If binding on a IP-Address fails, delay and retry again.

This happens mainly on IPv6 deployments. Due to DAD (Duplicate Address Detection)
or SLAAC it can be that IPv6 is not yet available when the daemons start.

Monitor daemons try to bind on a static IPv6 address and that might not be available
yet and that causes the monitor not to start.

Fixes: #10029
Cleanup: Drop hobject_incorrect_pool

This field in MOSDSubOp, used to support very old version
OSD(MOSDSubOp header version < 7, which was introduced in
mid 2012 by commit 2fe9816305fc1406ab7fb043bbb32affffc2d190)

Now since two years pasted, we don't need it anymore.

Signed-off-by: Xiaoxi Chen <xiaoxi.chen@intel.com>
osdc/Objecter: do notify completion callback in fast-dispatch context

The notify completion has exactly one user, the librados caller which
does nothing but take a local (inner) lock and signal a Cond.  Do this
in the fast-dispatch context for simplicity.

Notably, this makes the notify completion (and timeout) trigger a
notify2() return (with ETIMEDOUT) even when the finisher queue that
normally delivers notify is busy.. for example with a notify that is
being very slow.  In our case, the unit test is doing a sleep(3) to
test timeouts but also prevented the ETIMEDOUT notification from
being delivered to the caller.  This patch resolves that.

Signed-off-by: Sage Weil <sage@redhat.com>
librados: add rados_watch_flush() call

Add a call so that callers can make sure all queued callbacks have
completed before shutting down the ioctx.  This avoids a segv triggered
by the LibRadosWatchNotifyPPTests/LibRadosWatchNotifyPP.WatchNotify2Timeout/1
test due to the ioctx being destroyed when the in-progress callback
does a notify_ack.

Signed-off-by: Sage Weil <sage@redhat.com>
librados: watch_flush() on shutdown

Users can easily forget this. It makes shutdown potentially block, but if
they have racing callbacks they get what they ask for.

Signed-off-by: Sage Weil <sage@redhat.com>
remove unmatched op code comparasion

Signed-off-by: Dong Lei <leidong@yahoo-inc.com>
stop.sh: killall -u takes username, not uid

Signed-off-by: Dan Mick <dan.mick@redhat.com>
Merge pull request #3239 from ceph/wip-stop.sh-me

stop.sh: killall -u takes username, not uid

Reviewed-by: John Spray <john.spray@redhat.com>
Merge pull request #3138 from ceph/wip-10029

SimpleMessenger: Retry binding on addresses if binding fails

Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Merge pull request #3114 from xiaoxichen/drop_incorrect_pool

Cleanup: Drop hobject_incorrect_pool

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Sage Weil <sage@redhat.com>
librados: warn about rados_watch_flush() prior to ioctx shutdown

Signed-off-by: Sage Weil <sage@redhat.com>
Merge pull request #3222 from ceph/wip-watch-notify-2

librados: fix watch/notify event flushing

Reviewed-by: Samuel Just <sjust@redhat.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Merge pull request #3200 from boydc2014/master

fix unmatched op code

Reviewed-by: Loic Dachary <ldachary@redhat.com>
libcephfs/test.cc: close fd before umount

Fixes: #10415
Signed-off-by: Yan, Zheng <zyan@redhat.com>
librados: only call watch_flush if necessary

Fix bug #10424
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Merge pull request #3243 from yuyuyu101/wip-10424

librados: only call watch_flush if necessary

Reviewed-by: Loic Dachary <ldachary@redhat.com>
10132: osd: tries to set ioprio when the config option is blank

According to documentation, ioprio params will only be used if both
osd disk thread ioprio class and osd disk thread ioprio priority are
set to a non default value.

So, add a proper check and do not generate "set_disk_tp_priority(22)
Invalid argument" warning for the default settings.
Merge pull request #3245 from trociny/fix-10132

10132: osd: tries to set ioprio when the config option is blank

Reviewed-by: Sage Weil <sage@redhat.com>
Merge pull request #3241 from ceph/wip-10415

libcephfs/test.cc: close fd before umount

Reviewed-by: Sage Weil <sage@redhat.com>
AsyncMessenger: fix the leak of file_events

Signed-off-by: Kefu Chai <tchaikov@gmail.com>