You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/09/05 05:49:57 UTC

[GitHub] [incubator-doris] ZhangYu0123 opened a new pull request #4539: [storage][compatibility] Add meta format detection to prevent data loss.

ZhangYu0123 opened a new pull request #4539:
URL: https://github.com/apache/incubator-doris/pull/4539


   ## Proposed changes
   
   After 0.12 version, doris remove the format convert functiion which can convert from hdr_ format to tabletmeta_ format, the commit link: 3bca253
   
   When we update doris version and there are old format meta in storage, BE will not read the old format tablet. It can lead to data loss.
   
   So we add meta format detection function to prevent data loss. We there are old format meta, BE can find and print log or exit.
   
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [x] Bugfix (non-breaking change which fixes an issue)
   - [] New feature (non-breaking change which adds functionality)
   - [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
   - [] Documentation Update (if none of the other choices apply)
   - [] Code refactor (Modify the code structure, format the code, etc...)
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._
   
   - [x] I have create an issue on (Fix #4538 ), and have described the bug/feature there in detail
   - [x] Compiling and unit tests pass locally with my changes
   - [] I have added tests that prove my fix is effective or that my feature works
   - [] If this change need a document change, I have updated the document
   - [] Any dependent changes have been merged
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a change in pull request #4539: [storage][compatibility] Add meta format detection to prevent data loss.

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #4539: [storage][compatibility] Add meta format detection to prevent data loss.

Posted by GitBox <gi...@apache.org>.
morningman merged pull request #4539:
URL: https://github.com/apache/incubator-doris/pull/4539


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org