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

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


The following commit(s) were added to refs/heads/master by this push:
     new 0fada66e03 [fix](cooldown) Fix deadlock in tablet clone (#17252)
0fada66e03 is described below

commit 0fada66e03a63ff3bca219de8026e1c9b018ff23
Author: plat1ko <[email protected]>
AuthorDate: Fri Mar 3 15:53:12 2023 +0800

    [fix](cooldown) Fix deadlock in tablet clone (#17252)
---
 be/src/io/fs/s3_file_system.cpp     | 1 +
 be/src/olap/rowset/rowset.cpp       | 6 +++---
 be/src/olap/rowset/rowset.h         | 4 ++--
 be/src/olap/rowset/rowset_factory.h | 2 ++
 be/src/olap/tablet.cpp              | 2 +-
 5 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/be/src/io/fs/s3_file_system.cpp b/be/src/io/fs/s3_file_system.cpp
index 111f9f1723..ee2161975f 100644
--- a/be/src/io/fs/s3_file_system.cpp
+++ b/be/src/io/fs/s3_file_system.cpp
@@ -397,6 +397,7 @@ Status S3FileSystem::list(const Path& path, 
std::vector<Path>* files) {
             files->push_back(obj.GetKey().substr(prefix.size()));
         }
         is_trucated = outcome.GetResult().GetIsTruncated();
+        
request.SetContinuationToken(outcome.GetResult().GetNextContinuationToken());
     } while (is_trucated);
     return Status::OK();
 }
diff --git a/be/src/olap/rowset/rowset.cpp b/be/src/olap/rowset/rowset.cpp
index a85bc7dc2d..d29c02ed95 100644
--- a/be/src/olap/rowset/rowset.cpp
+++ b/be/src/olap/rowset/rowset.cpp
@@ -23,9 +23,9 @@
 
 namespace doris {
 
-Rowset::Rowset(TabletSchemaSPtr schema, const std::string& tablet_path,
-               RowsetMetaSharedPtr rowset_meta)
-        : _tablet_path(tablet_path), _rowset_meta(std::move(rowset_meta)), 
_refs_by_reader(0) {
+Rowset::Rowset(const TabletSchemaSPtr& schema, const std::string& tablet_path,
+               const RowsetMetaSharedPtr& rowset_meta)
+        : _tablet_path(tablet_path), _rowset_meta(rowset_meta), 
_refs_by_reader(0) {
     _is_pending = !_rowset_meta->has_version();
     if (_is_pending) {
         _is_cumulative = false;
diff --git a/be/src/olap/rowset/rowset.h b/be/src/olap/rowset/rowset.h
index 196de0cfbb..ea7fcf55e1 100644
--- a/be/src/olap/rowset/rowset.h
+++ b/be/src/olap/rowset/rowset.h
@@ -282,8 +282,8 @@ protected:
 
     DISALLOW_COPY_AND_ASSIGN(Rowset);
     // this is non-public because all clients should use RowsetFactory to 
obtain pointer to initialized Rowset
-    Rowset(TabletSchemaSPtr schema, const std::string& tablet_path,
-           RowsetMetaSharedPtr rowset_meta);
+    Rowset(const TabletSchemaSPtr& schema, const std::string& tablet_path,
+           const RowsetMetaSharedPtr& rowset_meta);
 
     // this is non-public because all clients should use RowsetFactory to 
obtain pointer to initialized Rowset
     virtual Status init() = 0;
diff --git a/be/src/olap/rowset/rowset_factory.h 
b/be/src/olap/rowset/rowset_factory.h
index 6f6b262456..d0adc6f457 100644
--- a/be/src/olap/rowset/rowset_factory.h
+++ b/be/src/olap/rowset/rowset_factory.h
@@ -31,6 +31,8 @@ class RowsetFactory {
 public:
     // return OK and set inited rowset in `*rowset`.
     // return others if failed to create or init rowset.
+    // NOTE: `rowset_meta` loaded from `RowsetMetaPB` before version 1.2 
doesn't have tablet schema,
+    //  use tablet's schema as rowset's schema for compatibility.
     static Status create_rowset(const TabletSchemaSPtr& schema, const 
std::string& tablet_path,
                                 const RowsetMetaSharedPtr& rowset_meta, 
RowsetSharedPtr* rowset);
 
diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp
index 0563e3dd76..4c10ca90d6 100644
--- a/be/src/olap/tablet.cpp
+++ b/be/src/olap/tablet.cpp
@@ -1643,7 +1643,7 @@ void 
Tablet::_init_context_common_fields(RowsetWriterContext& context) {
 }
 
 Status Tablet::create_rowset(const RowsetMetaSharedPtr& rowset_meta, 
RowsetSharedPtr* rowset) {
-    return RowsetFactory::create_rowset(tablet_schema(), tablet_path(), 
rowset_meta, rowset);
+    return RowsetFactory::create_rowset(_schema, tablet_path(), rowset_meta, 
rowset);
 }
 
 Status Tablet::cooldown() {


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

Reply via email to