Skip to content

Commit

Permalink
Fix misprocessing of "CLUSTER NODES" return
Browse files Browse the repository at this point in the history
  • Loading branch information
MoFHeka committed Nov 11, 2021
1 parent fcbe164 commit 0187542
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ class RedisWrapper<RedisInstance, K, V,
tmp_slot_num.reserve(4);
unsigned tmp_first_slot = 0, tmp_second_slot = 0;
for (auto row : csv_table) {
if (strcmp(row.at(2).data(), "master") == 0) {
if (strcmp(row.at(2).data(), "master") == 0 ||
strcmp(row.at(2).data(), "myself,master") == 0) {
if (full_slots) {
for (size_t i = 8; i < row.size(); ++i) {
for (const char *num = row.at(i).data();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,10 @@ std::vector<std::string> BuildKeysPrefixNameSlices(
}
}
} else {
LOG(WARNING) << "Nodes in Redis service is bigger than storage_slice "
"set by user, it may cause data skew.";
if (cluster_slots.size() > storage_slice) {
LOG(WARNING) << "Nodes in Redis service is bigger than storage_slice "
"set by user, it may cause data skew.";
}
for (unsigned i = 0; i < storage_slice; ++i) {
keys_prefix_name_slices.emplace_back(
keys_prefix_name + '{' +
Expand Down

0 comments on commit 0187542

Please sign in to comment.