the sole caller `Heartbeat::update_peers()` also returns future, so
there is no reason that `add_reporter_peers()` runs in background.
Signed-off-by: Kefu Chai <kchai@redhat.com>
before this chance, we do following things in background and in
parallel:
* add peers from pg map
* and peers from whole osdmap
* remove dead peers
but we should prioritize the peer candidates, apparently, the ones from
pgmap should have higher priority. as they are more likely to be used in
cluser and they are more important to current OSD, as they serve the
same set of PGs.
so we need to do these things in a proper order:
1. add peers from pg map
2. and peers from whole osdmap
3. remove dead peers
Signed-off-by: Kefu Chai <kchai@redhat.com>
before this change, we could initialize connections to newly added peers
in parallel repeatly, if an OSD is listed in up/acting of multiple PGs
served by current OSD.
after this change, we try to add the peer to `Heartbeat.peers` first,
and then try to connect to it with the hb front/back addresses, to avoid
potential repeatly connecting to peer.
Signed-off-by: Kefu Chai <kchai@redhat.com>
it's modeled after pgnls_filter. and use seastar::map_reduce() for
filtering the objects into the response.
Signed-off-by: Kefu Chai <kchai@redhat.com>
currently, OpsExecuter tries to load the object info for all ops to be
executed, but the PG ops do not require the existence of object
specified by op. so we need to specialize for them.
in this change,
* `OpsExecuter::execute_pg_op()` is added to handle pg ops without
loading object info first.
* `pgnls` and `pgnls_filter` are handled by
`OpsExecuter::execute_pg_op()`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
as pg ops should not require the object info, as there is chance that
the object specified in pg ops does not exist at all.
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa: avoid page cache for krbd discard round off tests
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
tools/rados: use num ops instead of num objs for tracking outstanding IO
Reviewed-by: Mark Nelson <mnelson@redhat.com>
Reviewed-by: Kefu Chai <kchai@redhat.com>
mgr/dashboard: Editing RGW bucket fails because of name is already in use
Reviewed-by: Stephan Müller <smueller@suse.com>
Reviewed-by: Laura Paduano <lpaduano@suse.com>
exit_open should be set atomically with state checks and
write_dispatching changes, or there would be chances to be blocked
forever by exit_open.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
It's OK to discard the returned future of Connection::close() because
Messenger::shutdown() will wait for all connections closed.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
We are using with_gate() to wrap a slow operation when we want to start
it but don't want/need to wait it to be finished in the same function.
In this case, the future returned from with_gate() is discarded, and we
need to make sure there is another continuation responsible to waiting
for the gate closed.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
With the new ESTABLISHING state, connection lookup and acceptance can be
atomic, solving the issues related to racing connect.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
wait_replaced(count): wait for connection replaced;
wait_established(): wait for all pending messages sent and received;
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
It is possible to lose message at server side due to lossy policy,
causing unit test blocked and waiting for lost replies.
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>