Skip to content

Commit

Permalink
ensuring that when there are multiple shards the keys pool is bellow …
Browse files Browse the repository at this point in the history
…request count(when defined)
  • Loading branch information
filipecosta90 committed Feb 7, 2023
1 parent 15edf14 commit 19c079b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cluster_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,10 @@ bool cluster_client::get_key_for_conn(unsigned int conn_id, int iter, unsigned l
continue;

// store key for other connection, if queue is not full
// and the total number of requests is larger than m_key_index_pools.size() * KEY_INDEX_QUEUE_MAX_SIZE
key_index_pool* key_idx_pool = m_key_index_pools[other_conn_id];
if (key_idx_pool->size() < KEY_INDEX_QUEUE_MAX_SIZE) {
if (key_idx_pool->size() < KEY_INDEX_QUEUE_MAX_SIZE &&
(m_config->requests == 0 || (m_key_index_pools.size() * KEY_INDEX_QUEUE_MAX_SIZE) < m_config->requests)) {
key_idx_pool->push(*key_index);
m_reqs_generated++;
}
Expand Down

0 comments on commit 19c079b

Please sign in to comment.