Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensuring that when there are multiple shards the keys pool is bellow request count(when defined) #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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