morningman commented on a change in pull request #4539:
URL: https://github.com/apache/incubator-doris/pull/4539#discussion_r483929199



##########
File path: be/src/olap/data_dir.cpp
##########
@@ -602,13 +602,47 @@ OLAPStatus DataDir::set_convert_finished() {
     return OLAP_SUCCESS;
 }
 
+OLAPStatus DataDir::_check_incompatible_old_format_tablet() {
+
+    auto check_incompatible_old_func = [this](int64_t tablet_id, int32_t 
schema_hash,
+                                              const std::string& value) -> 
bool {
+                                                  
+        // if strict check incompatible old format, then log fatal
+        if (config::storage_strict_check_incompatible_old_format) {
+            LOG(FATAL) << "There are incompatible old format metas, current 
version does not support "
+                       << "and it may lead to data missing!!! "
+                       << "talbet_id = " << tablet_id << " schema_hash = " << 
schema_hash;
+        } else {
+            LOG(WARNING)
+                    << "There are incompatible old format metas, current 
version does not support "
+                    << "and it may lead to data missing!!! "
+                    << "talbet_id = " << tablet_id << " schema_hash = " << 
schema_hash;
+        }
+        return false;
+    };
+
+    // seek old header prefix. when check_incompatible_old_func is called, it 
has old format in olap_meta
+    OLAPStatus check_incompatible_old_status = 
TabletMetaManager::traverse_headers(
+            _meta, check_incompatible_old_func, OLD_HEADER_PREFIX);
+    if (check_incompatible_old_status != OLAP_SUCCESS) {
+        LOG(WARNING) << "check incompatible old format meta fails, it may lead 
to data missing!!!" << _path;

Review comment:
       ```suggestion
           LOG(WARNING) << "check incompatible old format meta fails, it may 
lead to data missing!!! " << _path;
   ```




----------------------------------------------------------------
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.

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