This is an automated email from the ASF dual-hosted git repository.

yangzhg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 630e273  use segmentV2 as default storage format for old tables using 
storage format 'DEFAULT' (#6807)
630e273 is described below

commit 630e273d94a3c1fe4bae4c814daca6e4f5597c5f
Author: Zhengguo Yang <[email protected]>
AuthorDate: Wed Oct 13 11:34:40 2021 +0800

    use segmentV2 as default storage format for old tables using storage format 
'DEFAULT' (#6807)
---
 be/src/olap/tablet_manager.cpp                     | 23 +++++++++++-----------
 .../java/org/apache/doris/qe/GlobalVariable.java   |  2 +-
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/be/src/olap/tablet_manager.cpp b/be/src/olap/tablet_manager.cpp
index a3bd45a..cabd32d 100644
--- a/be/src/olap/tablet_manager.cpp
+++ b/be/src/olap/tablet_manager.cpp
@@ -71,7 +71,8 @@ static bool _cmp_tablet_by_create_time(const TabletSharedPtr& 
a, const TabletSha
 }
 
 TabletManager::TabletManager(int32_t tablet_map_lock_shard_size)
-        : _mem_tracker(MemTracker::CreateTracker(-1, "TabletMeta", nullptr, 
false, false, MemTrackerLevel::OVERVIEW)),
+        : _mem_tracker(MemTracker::CreateTracker(-1, "TabletMeta", nullptr, 
false, false,
+                                                 MemTrackerLevel::OVERVIEW)),
           _tablets_shards_size(tablet_map_lock_shard_size),
           _tablets_shards_mask(tablet_map_lock_shard_size - 1),
           _last_update_stat_ms(0) {
@@ -274,8 +275,8 @@ OLAPStatus TabletManager::create_tablet(const 
TCreateTabletReq& request,
     TRACE("got base tablet");
 
     // set alter type to schema-change. it is useless
-    TabletSharedPtr tablet = _internal_create_tablet_unlocked(
-            request, is_schema_change, base_tablet.get(), stores);
+    TabletSharedPtr tablet =
+            _internal_create_tablet_unlocked(request, is_schema_change, 
base_tablet.get(), stores);
     if (tablet == nullptr) {
         LOG(WARNING) << "fail to create tablet. tablet_id=" << 
request.tablet_id;
         DorisMetrics::instance()->create_tablet_requests_failed->increment(1);
@@ -289,8 +290,7 @@ OLAPStatus TabletManager::create_tablet(const 
TCreateTabletReq& request,
 }
 
 TabletSharedPtr TabletManager::_internal_create_tablet_unlocked(
-        const TCreateTabletReq& request,
-        const bool is_schema_change, const Tablet* base_tablet,
+        const TCreateTabletReq& request, const bool is_schema_change, const 
Tablet* base_tablet,
         const std::vector<DataDir*>& data_dirs) {
     // If in schema-change state, base_tablet must also be provided.
     // i.e., is_schema_change and base_tablet are either assigned or not 
assigned
@@ -347,7 +347,7 @@ TabletSharedPtr 
TabletManager::_internal_create_tablet_unlocked(
             // 2. Because the unit of second is unified in the olap engine 
code,
             //    if two operations (such as creating a table, and then 
immediately altering the table)
             //    is less than 1s, then the creation_time of the new table and 
the old table obtained by alter will be the same
-            // 
+            //
             // When the above two situations occur, in order to be able to 
distinguish between the new tablet
             // obtained by alter and the old tablet, the creation_time of the 
new tablet is set to
             // the creation_time of the old tablet increased by 1
@@ -659,10 +659,10 @@ TabletSharedPtr 
TabletManager::find_best_tablet_to_compaction(
                 }
                 if (now_ms - last_failure_ms <=
                     config::min_compaction_failure_interval_sec * 1000) {
-                    VLOG_DEBUG    << "Too often to check compaction, skip it. "
-                                  << "compaction_type=" << compaction_type_str
-                                  << ", last_failure_time_ms=" << 
last_failure_ms
-                                  << ", tablet_id=" << tablet_ptr->tablet_id();
+                    VLOG_DEBUG << "Too often to check compaction, skip it. "
+                               << "compaction_type=" << compaction_type_str
+                               << ", last_failure_time_ms=" << last_failure_ms
+                               << ", tablet_id=" << tablet_ptr->tablet_id();
                     continue;
                 }
 
@@ -1318,8 +1318,7 @@ OLAPStatus 
TabletManager::_create_tablet_meta_unlocked(const TCreateTabletReq& r
     OLAPStatus res = TabletMeta::create(request, TabletUid::gen_uid(), 
shard_id, next_unique_id,
                                         col_idx_to_unique_id, tablet_meta);
 
-    // TODO(lingbin): when beta-rowset is default, should remove it
-    if (request.__isset.storage_format && request.storage_format == 
TStorageFormat::V2) {
+    if (request.__isset.storage_format && request.storage_format != 
TStorageFormat::V1) {
         (*tablet_meta)->set_preferred_rowset_type(BETA_ROWSET);
     } else {
         (*tablet_meta)->set_preferred_rowset_type(ALPHA_ROWSET);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
index 60decf2..923a8b3 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/GlobalVariable.java
@@ -74,7 +74,7 @@ public final class GlobalVariable {
     public volatile static long queryCacheSize = 1048576;
 
     @VariableMgr.VarAttr(name = DEFAULT_ROWSET_TYPE, flag = VariableMgr.GLOBAL)
-    public volatile static String defaultRowsetType = "alpha";
+    public volatile static String defaultRowsetType = "beta";
 
     // add performance schema to support MYSQL JDBC 8.0.16 or later versions.
     @VariableMgr.VarAttr(name = PERFORMANCE_SCHEMA, flag = 
VariableMgr.READ_ONLY)

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

Reply via email to