-
Notifications
You must be signed in to change notification settings - Fork 526
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 insert inode fail when load deleting partition #997
fix insert inode fail when load deleting partition #997
Conversation
04a3483
to
e725958
Compare
if (rc != MetaStatusCode::OK) { | ||
LOG(ERROR) << "InsertInode failed, retCode = " << rc; | ||
LOG(ERROR) << "InsertInode failed, retCode = " |
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.
using “:” instead of “=” in log
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.
you should add tests to verify this patch.
@@ -137,6 +130,20 @@ bool MetaStoreImpl::Load(const std::string& pathname) { | |||
partitionMap_.clear(); | |||
LOG(ERROR) << "Load metadata failed."; | |||
} | |||
|
|||
for (auto it = partitionMap_.begin(); it != partitionMap_.end(); 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.
use range-based for loop
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.
The two methods are equivalent
e725958
to
63f8fd3
Compare
done, add test case |
@@ -94,7 +94,10 @@ class MetastoreTest : public ::testing::Test { | |||
first.partitionid() == second.partitionid() && | |||
first.start() == second.start() && | |||
first.end() == second.end() && | |||
first.nextid() == second.nextid(); | |||
first.nextid() == second.nextid() && |
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.
you can use google::protobuf::util::MessageDifferencer::Equals
to simplify this compare
recheck |
2 similar comments
recheck |
recheck |
63f8fd3
to
d083c59
Compare
What problem does this PR solve?
Issue Number: #995
Problem Summary: fix insert inode fail when load deleting partition
What is changed and how it works?
What's Changed:
How it Works:
Side effects(Breaking backward compatibility? Performance regression?):
Check List