From ec45f1e51d58ee8eff409dffcfedf7e7c7de9575 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Thu, 4 May 2017 14:31:00 +0200 Subject: [PATCH] sstables: index_reader: Fix abort in advance_and_check_if_present() Happens when the key is missing and after all keys in the sstables. Fixes #2345. --- sstables/index_reader.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sstables/index_reader.hh b/sstables/index_reader.hh index ccbf743c01..1f91d8d40a 100644 --- a/sstables/index_reader.hh +++ b/sstables/index_reader.hh @@ -500,6 +500,9 @@ public: // Like advance_to(dht::ring_position_view), but returns information whether the key was found future advance_and_check_if_present(dht::ring_position_view key) { return advance_to(key).then([this, key] { + if (eof()) { + return make_ready_future(false); + } return ensure_partition_data().then([this, key] { dht::ring_position_comparator cmp(*_sstable->_schema); return cmp(key, partition_key()) == 0;