Skip to content

Commit

Permalink
debug: SlotsMgrtTagSlotAsyncCmd always using default table (OpenAtomF…
Browse files Browse the repository at this point in the history
…oundation#900)

* debug: SlotsMgrtTagSlotAsync always using default table
  • Loading branch information
kernelai authored and whoiami committed May 21, 2020
1 parent 7d3b2b1 commit 9324b3e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/pika_slot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,15 @@ void SlotsMgrtTagSlotAsyncCmd::DoInitial() {
std::string str_max_bytes_ = *it++;

std::string str_slot_num = *it++;

std::shared_ptr<Table> table = g_pika_server->GetTable(table_name_);
if (table == NULL) {
res_.SetRes(CmdRes::kNotFound, kCmdNameSlotsMgrtTagSlotAsync);
return;
}

if (!slash::string2l(str_slot_num.data(), str_slot_num.size(), &slot_num_)
|| slot_num_ < 0 || slot_num_ >= g_pika_conf->default_slot_num()) {
|| slot_num_ < 0 || slot_num_ >= table->PartitionNum()) {
res_.SetRes(CmdRes::kInvalidInt, kCmdNameSlotsMgrtTagSlotAsync);
return;
}
Expand All @@ -166,9 +173,9 @@ void SlotsMgrtTagSlotAsyncCmd::Do(std::shared_ptr<Partition> partition) {
// proxy retry cached request in new node
bool is_exist = true;
std::shared_ptr<SyncMasterPartition> master_partition =
g_pika_rm->GetSyncMasterPartitionByName(PartitionInfo(g_pika_conf->default_table(), slot_num_));
g_pika_rm->GetSyncMasterPartitionByName(PartitionInfo(table_name_, slot_num_));
if (!master_partition) {
LOG(WARNING) << "Sync Master Partition: " << g_pika_conf->default_table() << ":" << slot_num_
LOG(WARNING) << "Sync Master Partition: " << table_name_ << ":" << slot_num_
<< ", NotFound";
res_.SetRes(CmdRes::kNotFound, kCmdNameSlotsMgrtTagSlotAsync);
return;
Expand Down

0 comments on commit 9324b3e

Please sign in to comment.