-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: slotmigrate return not correct #2741
Changes from 1 commit
3a0a5bf
6166e47
fa5152b
bfc8ab4
57cea70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -654,11 +654,14 @@ int PikaMigrateThread::ReqMigrateOne(const std::string& key, const std::shared_p | |
key_type = storage::DataTypeToTag(type); | ||
if (type == storage::DataType::kNones) { | ||
LOG(WARNING) << "PikaMigrateThread::ReqMigrateOne key: " << key << " type: " << static_cast<int>(type) << " is illegal"; | ||
return 0; | ||
} else { | ||
LOG(WARNING) << "PikaMigrateThread::ReqMigrateOne key: "<< key <<" type: " << static_cast<int>(type) << " is illegal"; | ||
return -1; | ||
} | ||
if (slot_id != slot_id_) { | ||
LOG(WARNING) << "PikaMigrateThread::ReqMigrateOne Slot : " << slot_id << " is not the migrating slot:" << slot_id_; | ||
return -2; | ||
return -1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification The extracted code indicates that there is a logical inconsistency. Specifically, the
This needs to be addressed to ensure the correct sequence of operations. Analysis chainUpdated return logic and logging for different data types in Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the consistency of return values and logging messages across the codebase.
# Test: Search for similar patterns in other migration-related functions.
rg --type cpp "PikaMigrateThread::ReqMigrateOne"
Length of output: 1177 Script: #!/bin/bash
# Extract the full implementation of the ReqMigrateOne function from the source file.
ast-grep --lang cpp --pattern 'int PikaMigrateThread::ReqMigrateOne($$$) { $$$ }' src/pika_migrate_thread.cc
Length of output: 110 Script: #!/bin/bash
# Search for the ReqMigrateOne function signature and surrounding lines to capture the full implementation.
rg --type cpp -A 50 -B 10 "int PikaMigrateThread::ReqMigrateOne" src/pika_migrate_thread.cc
Length of output: 2129 |
||
} | ||
|
||
// if the migrate thread exit, start it | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个判断还需要加吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不对slot_id校验直接走下面逻辑塞进队列?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
嗯嗯,等于是不管这个 key 所属的 slot 是否在迁移,我都能把这个 key 迁走
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果你不是所属迁移的slot你也不会进入到这里来吧,因为你不可能是migrating状态