diff --git a/db/consistency_level.cc b/db/consistency_level.cc index 8d7f05b369..3de58b9a8d 100644 --- a/db/consistency_level.cc +++ b/db/consistency_level.cc @@ -25,6 +25,7 @@ #include "db/consistency_level.hh" #include +#include #include "exceptions/exceptions.hh" #include "core/sstring.hh" #include "schema.hh" @@ -171,6 +172,11 @@ filter_for_query(consistency_level cl, * replica gets the data read) or not (since we'll take the block_for first * ones). */ + // FIXME: before dynamic snitch is implement put local address (if present) at the beginning + auto it = boost::range::find(live_endpoints, utils::fb_utilities::get_broadcast_address()); + if (it != live_endpoints.end() && it != live_endpoints.begin()) { + std::iter_swap(it, live_endpoints.begin()); + } if (is_datacenter_local(cl)) { boost::range::partition(live_endpoints, is_local); }