Skip to content

Commit b2916c4

Browse files
committedOct 11, 2023
[fix] curvefs: mds: createfs error
Signed-off-by: swj <1186093704@qq.com>
1 parent 505cc7a commit b2916c4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed
 

‎curvefs/src/mds/fs_manager.cpp

+10-3
Original file line numberDiff line numberDiff line change
@@ -795,15 +795,22 @@ int FsManager::IsExactlySameOrCreateUnComplete(const std::string& fsName,
795795
return google::protobuf::util::MessageDifferencer::Equals(lhs, rhs);
796796
};
797797

798-
auto checkFsInfo = [fsType, volumeInfoComparator](const FsDetail& lhs,
798+
auto s3InfoComparator = [](common::S3Info lhs, common::S3Info rhs) {
799+
// for compatible with old clients
800+
lhs.clear_objectprefix();
801+
rhs.clear_objectprefix();
802+
return google::protobuf::util::MessageDifferencer::Equals(lhs, rhs);
803+
};
804+
805+
auto checkFsInfo = [fsType, volumeInfoComparator, s3InfoComparator](const FsDetail& lhs,
799806
const FsDetail& rhs) {
800807
switch (fsType) {
801808
case curvefs::common::FSType::TYPE_S3:
802-
return MessageDifferencer::Equals(lhs.s3info(), rhs.s3info());
809+
return s3InfoComparator(lhs.s3info(), rhs.s3info());
803810
case curvefs::common::FSType::TYPE_VOLUME:
804811
return volumeInfoComparator(lhs.volume(), rhs.volume());
805812
case curvefs::common::FSType::TYPE_HYBRID:
806-
return MessageDifferencer::Equals(lhs.s3info(), rhs.s3info()) &&
813+
return s3InfoComparator(lhs.s3info(), rhs.s3info()) &&
807814
volumeInfoComparator(lhs.volume(), rhs.volume());
808815
}
809816

0 commit comments

Comments
 (0)