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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 4fa2bdef20c [Pick](Branch-2.0) pick to fix tablet_id overflow #34912 
#34962 (#34995)
4fa2bdef20c is described below

commit 4fa2bdef20c460190853703a54b9aa2850b1e22a
Author: lihangyu <[email protected]>
AuthorDate: Mon May 20 11:59:34 2024 +0800

    [Pick](Branch-2.0) pick to fix tablet_id overflow #34912 #34962 (#34995)
    
    Co-authored-by: abmdocrt <[email protected]>
---
 be/src/olap/iterators.h                          | 2 +-
 be/src/olap/rowset/segment_v2/column_reader.h    | 4 ++--
 be/src/olap/rowset/segment_v2/segment_iterator.h | 4 ++--
 be/src/olap/schema_cache.cpp                     | 4 ++--
 be/src/olap/schema_cache.h                       | 4 ++--
 be/src/olap/tablet_schema.h                      | 6 +++---
 be/src/olap/utils.h                              | 4 ++--
 be/src/runtime/descriptors.h                     | 4 ++--
 8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/be/src/olap/iterators.h b/be/src/olap/iterators.h
index 68ebc98570c..7be18697da8 100644
--- a/be/src/olap/iterators.h
+++ b/be/src/olap/iterators.h
@@ -109,7 +109,7 @@ public:
     RuntimeState* runtime_state = nullptr;
     RowsetId rowset_id;
     Version version;
-    int32_t tablet_id = 0;
+    int64_t tablet_id = 0;
     size_t topn_limit = 0;
 };
 
diff --git a/be/src/olap/rowset/segment_v2/column_reader.h 
b/be/src/olap/rowset/segment_v2/column_reader.h
index deed1fec1fc..123f1c5f2e8 100644
--- a/be/src/olap/rowset/segment_v2/column_reader.h
+++ b/be/src/olap/rowset/segment_v2/column_reader.h
@@ -550,7 +550,7 @@ private:
 class RowIdColumnIterator : public ColumnIterator {
 public:
     RowIdColumnIterator() = delete;
-    RowIdColumnIterator(int32_t tid, RowsetId rid, int32_t segid)
+    RowIdColumnIterator(int64_t tid, RowsetId rid, int32_t segid)
             : _tablet_id(tid), _rowset_id(rid), _segment_id(segid) {}
 
     Status seek_to_first() override {
@@ -592,7 +592,7 @@ public:
 
 private:
     rowid_t _current_rowid = 0;
-    int32_t _tablet_id = 0;
+    int64_t _tablet_id = 0;
     RowsetId _rowset_id;
     int32_t _segment_id = 0;
 };
diff --git a/be/src/olap/rowset/segment_v2/segment_iterator.h 
b/be/src/olap/rowset/segment_v2/segment_iterator.h
index 34aea501317..adaa06b6ba2 100644
--- a/be/src/olap/rowset/segment_v2/segment_iterator.h
+++ b/be/src/olap/rowset/segment_v2/segment_iterator.h
@@ -120,7 +120,7 @@ public:
     bool is_lazy_materialization_read() const override { return 
_lazy_materialization_read; }
     uint64_t data_id() const override { return _segment->id(); }
     RowsetId rowset_id() const { return _segment->rowset_id(); }
-    int32_t tablet_id() const { return _tablet_id; }
+    int64_t tablet_id() const { return _tablet_id; }
 
     bool update_profile(RuntimeProfile* profile) override {
         bool updated = false;
@@ -430,7 +430,7 @@ private:
     // used to collect filter information.
     std::vector<ColumnPredicate*> _filter_info_id;
     bool _record_rowids = false;
-    int32_t _tablet_id = 0;
+    int64_t _tablet_id = 0;
     std::set<int32_t> _output_columns;
 };
 
diff --git a/be/src/olap/schema_cache.cpp b/be/src/olap/schema_cache.cpp
index 39d1a60a4c2..64e51ed5abb 100644
--- a/be/src/olap/schema_cache.cpp
+++ b/be/src/olap/schema_cache.cpp
@@ -38,7 +38,7 @@ namespace doris {
 SchemaCache* SchemaCache::_s_instance = nullptr;
 
 // format: tabletId-unique_id1-uniqueid2...-version-type
-std::string SchemaCache::get_schema_key(int32_t tablet_id, const 
TabletSchemaSPtr& schema,
+std::string SchemaCache::get_schema_key(int64_t tablet_id, const 
TabletSchemaSPtr& schema,
                                         const std::vector<uint32_t>& 
column_ids, int32_t version,
                                         Type type) {
     if (column_ids.empty() || schema->column(column_ids[0]).unique_id() < 0) {
@@ -55,7 +55,7 @@ std::string SchemaCache::get_schema_key(int32_t tablet_id, 
const TabletSchemaSPt
 }
 
 // format: tabletId-unique_id1-uniqueid2...-version-type
-std::string SchemaCache::get_schema_key(int32_t tablet_id, const 
std::vector<TColumn>& columns,
+std::string SchemaCache::get_schema_key(int64_t tablet_id, const 
std::vector<TColumn>& columns,
                                         int32_t version, Type type) {
     if (columns.empty() || columns[0].col_unique_id < 0) {
         return "";
diff --git a/be/src/olap/schema_cache.h b/be/src/olap/schema_cache.h
index f34f7c296d8..809a31632de 100644
--- a/be/src/olap/schema_cache.h
+++ b/be/src/olap/schema_cache.h
@@ -53,10 +53,10 @@ public:
     static void create_global_instance(size_t capacity);
 
     // get cache schema key, delimiter with SCHEMA_DELIMITER
-    static std::string get_schema_key(int32_t tablet_id, const 
TabletSchemaSPtr& schema,
+    static std::string get_schema_key(int64_t tablet_id, const 
TabletSchemaSPtr& schema,
                                       const std::vector<uint32_t>& column_ids, 
int32_t version,
                                       Type type);
-    static std::string get_schema_key(int32_t tablet_id, const 
std::vector<TColumn>& columns,
+    static std::string get_schema_key(int64_t tablet_id, const 
std::vector<TColumn>& columns,
                                       int32_t version, Type type);
 
     // Get a shared cached schema from cache, schema_key is a subset of column 
unique ids
diff --git a/be/src/olap/tablet_schema.h b/be/src/olap/tablet_schema.h
index 11f87f29387..8947beb6326 100644
--- a/be/src/olap/tablet_schema.h
+++ b/be/src/olap/tablet_schema.h
@@ -281,8 +281,8 @@ public:
     vectorized::Block create_block(bool ignore_dropped_col = true) const;
     void set_schema_version(int32_t version) { _schema_version = version; }
 
-    void set_table_id(int32_t table_id) { _table_id = table_id; }
-    int32_t table_id() const { return _table_id; }
+    void set_table_id(int64_t table_id) { _table_id = table_id; }
+    int64_t table_id() const { return _table_id; }
     void build_current_tablet_schema(int64_t index_id, int32_t version,
                                      const OlapTableIndexSchema* index,
                                      const TabletSchema& out_tablet_schema);
@@ -364,7 +364,7 @@ private:
     int32_t _sequence_col_idx = -1;
     int32_t _version_col_idx = -1;
     int32_t _schema_version = -1;
-    int32_t _table_id = -1;
+    int64_t _table_id = -1;
     bool _disable_auto_compaction = false;
     bool _enable_single_replica_compaction = false;
     int64_t _mem_size = 0;
diff --git a/be/src/olap/utils.h b/be/src/olap/utils.h
index 75df35e32ac..619b883c580 100644
--- a/be/src/olap/utils.h
+++ b/be/src/olap/utils.h
@@ -297,9 +297,9 @@ struct RowLocation {
 };
 
 struct GlobalRowLoacation {
-    GlobalRowLoacation(uint32_t tid, RowsetId rsid, uint32_t sid, uint32_t rid)
+    GlobalRowLoacation(int64_t tid, RowsetId rsid, uint32_t sid, uint32_t rid)
             : tablet_id(tid), row_location(rsid, sid, rid) {}
-    uint32_t tablet_id;
+    int64_t tablet_id;
     RowLocation row_location;
 
     bool operator==(const GlobalRowLoacation& rhs) const {
diff --git a/be/src/runtime/descriptors.h b/be/src/runtime/descriptors.h
index 36196461b30..c4adbb8d4b3 100644
--- a/be/src/runtime/descriptors.h
+++ b/be/src/runtime/descriptors.h
@@ -172,13 +172,13 @@ public:
     ::doris::TTableType::type table_type() const { return _table_type; }
     const std::string& name() const { return _name; }
     const std::string& database() const { return _database; }
-    int32_t table_id() const { return _table_id; }
+    int64_t table_id() const { return _table_id; }
 
 private:
     ::doris::TTableType::type _table_type;
     std::string _name;
     std::string _database;
-    int32_t _table_id;
+    int64_t _table_id;
     int _num_cols;
     int _num_clustering_cols;
 };


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

Reply via email to