提交 9324b3eb 编写于 作者: K kernelai 提交者: Zhao Minghuan

debug: SlotsMgrtTagSlotAsyncCmd always using default table (#900)

* debug: SlotsMgrtTagSlotAsync always using default table
上级 7d3b2b1c
......@@ -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;
}
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册