gavinchou commented on code in PR #53876:
URL: https://github.com/apache/doris/pull/53876#discussion_r2230566328


##########
cloud/src/recycler/checker.cpp:
##########
@@ -793,76 +823,240 @@ int InstanceChecker::do_inverted_check() {
 
         return 0;
     };
-    auto check_inverted_index_file = [&](const std::string& obj_key) {
+
+    auto check_inverted_index_file_storage_format_v1 = [&](int64_t tablet_id,
+                                                           const std::string& 
obj_key,
+                                                           const std::string& 
rowset_info) {
+        // format v1: 
data/{tablet_id}/{rowset_id}_{seg_num}_{idx_id}{idx_suffix}.idx
+        int64_t rowset_id, segment_id;
+        std::string index_id_with_suffix_name;
+        // {rowset_id}_{seg_num}_{idx_id}{idx_suffix}.idx
         std::vector<std::string> str;
-        butil::SplitString(obj_key, '/', &str);
-        // data/{tablet_id}/{rowset_id}_{seg_num}_{idx_id}{idx_suffix}.idx
+        butil::SplitString(rowset_info.substr(0, rowset_info.size() - 4), '_', 
&str);
         if (str.size() < 3) {
+            LOG(WARNING) << "Split rowset info with '_' error, str size < 3, 
rowset_info = "
+                         << rowset_info;
             return -1;
         }
+        rowset_id = std::atoll(str[0].c_str());
+        segment_id = std::atoll(str[1].c_str());
+        index_id_with_suffix_name = str[2];
 
-        int64_t tablet_id = atol(str[1].c_str());
-        if (tablet_id <= 0) {
-            LOG(WARNING) << "failed to parse tablet_id, key=" << obj_key;
+        if (rowset_index_cache_v1.rowset_id == rowset_id) {
+            if (rowset_index_cache_v1.segment_ids.contains(segment_id)) {
+                if (auto it = 
rowset_index_cache_v1.index_ids.find(index_id_with_suffix_name);
+                    it == rowset_index_cache_v1.index_ids.end()) {
+                    LOG(WARNING) << fmt::format(
+                            "index_id with suffix name not found, rowset_info 
= {}, obj_key = "
+                            "{}",
+                            rowset_info, obj_key);
+                    return -1;
+                }
+            } else {
+                LOG(WARNING) << fmt::format(

Review Comment:
   bad format



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to