github-actions[bot] commented on code in PR #30560:
URL: https://github.com/apache/doris/pull/30560#discussion_r1470660283


##########
be/src/olap/base_tablet.cpp:
##########
@@ -135,12 +135,50 @@ BaseTablet::BaseTablet(TabletMetaSharedPtr tablet_meta) : 
_tablet_meta(std::move
     INT_COUNTER_METRIC_REGISTER(_metric_entity, query_scan_count);
     INT_COUNTER_METRIC_REGISTER(_metric_entity, flush_bytes);
     INT_COUNTER_METRIC_REGISTER(_metric_entity, flush_finish_count);
+
+    // if !_tablet_meta->all_rs_metas()[0]->tablet_schema(),
+    // that mean the tablet_meta is still no upgrade to doris 1.2 versions.
+    // Before doris 1.2 version, rowset metas don't have tablet schema.
+    // And when upgrade to doris 1.2 version,
+    // all rowset metas will be set the tablet schmea from tablet meta.
+    if (_tablet_meta->all_rs_metas().empty() || 
!_tablet_meta->all_rs_metas()[0]->tablet_schema()) {
+        _max_version_schema = _tablet_meta->tablet_schema();
+    } else {
+        _max_version_schema =
+                
tablet_schema_with_merged_max_schema_version(_tablet_meta->all_rs_metas());
+    }
+    DCHECK(_max_version_schema);
 }
 
 BaseTablet::~BaseTablet() {
     
DorisMetrics::instance()->metric_registry()->deregister_entity(_metric_entity);
 }
 
+TabletSchemaSPtr BaseTablet::tablet_schema_with_merged_max_schema_version(

Review Comment:
   warning: method 'tablet_schema_with_merged_max_schema_version' can be made 
static [readability-convert-member-functions-to-static]
   
   ```suggestion
   static TabletSchemaSPtr 
BaseTablet::tablet_schema_with_merged_max_schema_version(
   ```
   



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