Skip to content

Commit

Permalink
server: fix iterate_count of multi_get (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan authored and acelyc111 committed Dec 14, 2018
1 parent 9ea2311 commit 67b1c96
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/pegasus_server_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,6 @@ void pegasus_server_impl::on_multi_get(const ::dsn::apps::multi_get_request &req
it->Seek(start);
bool first_exclusive = !start_inclusive;
while (count < max_kv_count && size < max_kv_size && it->Valid()) {
iterate_count++;

// check stop sort key
int c = it->key().compare(stop);
if (c > 0 || (c == 0 && !stop_inclusive)) {
Expand All @@ -747,6 +745,8 @@ void pegasus_server_impl::on_multi_get(const ::dsn::apps::multi_get_request &req
}
}

iterate_count++;

// extract value
int r = append_key_value_for_multi_get(resp.kvs,
it->key(),
Expand Down Expand Up @@ -778,8 +778,6 @@ void pegasus_server_impl::on_multi_get(const ::dsn::apps::multi_get_request &req
bool first_exclusive = !stop_inclusive;
std::vector<::dsn::apps::key_value> reverse_kvs;
while (count < max_kv_count && size < max_kv_size && it->Valid()) {
iterate_count++;

// check start sort key
int c = it->key().compare(start);
if (c < 0 || (c == 0 && !start_inclusive)) {
Expand All @@ -798,6 +796,8 @@ void pegasus_server_impl::on_multi_get(const ::dsn::apps::multi_get_request &req
}
}

iterate_count++;

// extract value
int r = append_key_value_for_multi_get(reverse_kvs,
it->key(),
Expand Down

0 comments on commit 67b1c96

Please sign in to comment.