From cb16cd7724cbcd7a5ebfdc81518355eee9224278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Wed, 4 Jul 2018 06:45:08 +0300 Subject: [PATCH] query_pager: use query::is_single_partition() to check for singular range MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use query::is_single_partition() to check whether the queried ranges are singular or not. The current method of using `dht::partition_range::is_singular()` is incorrect, as it is possible to build a singular range that doesn't represent a single partition. `query::is_single_partition()` correctly checks for this so use it instead. Found during code-review. Signed-off-by: Botond Dénes Message-Id: (cherry picked from commit 8084ce3a8e929dcde52454fc1da5336b340dbae6) --- service/pager/query_pagers.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/pager/query_pagers.cc b/service/pager/query_pagers.cc index 75becbee64..ce9c19b126 100644 --- a/service/pager/query_pagers.cc +++ b/service/pager/query_pagers.cc @@ -83,7 +83,7 @@ private: _last_replicas = state->get_last_replicas(); } else { // Reusing readers is currently only supported for singular queries. - if (!_ranges.empty() && _ranges.front().is_singular()) { + if (!_ranges.empty() && query::is_single_partition(_ranges.front())) { _cmd->query_uuid = utils::make_random_uuid(); } _cmd->is_first_page = true;