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

zhangchen 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 d0960bac561 [Fix](partial update) Fix partial update info loss when 
the delete bitmaps of the committed transactions are calculated by the 
compaction (#26556)
d0960bac561 is described below

commit d0960bac5613581edc9e2dc00a31a9ceb9b51055
Author: bobhan1 <bh2444151...@outlook.com>
AuthorDate: Wed Nov 8 19:56:31 2023 +0800

    [Fix](partial update) Fix partial update info loss when the delete bitmaps 
of the committed transactions are calculated by the compaction (#26556)
    
    a fix for #25147
---
 be/src/olap/compaction.cpp  | 34 +++++++++++++++++-----------------
 be/src/olap/txn_manager.cpp |  7 +++++--
 be/src/olap/txn_manager.h   |  7 +++++--
 3 files changed, 27 insertions(+), 21 deletions(-)

diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index b025555166a..415be6bb0af 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -718,24 +718,24 @@ Status Compaction::modify_rowsets(const 
Merger::Statistics* stats) {
                     // Therefore, we need to check if every committed rowset 
has calculated delete bitmap for
                     // all compaction input rowsets.
                     continue;
-                } else {
-                    DeleteBitmap 
txn_output_delete_bitmap(_tablet->tablet_id());
-                    _tablet->calc_compaction_output_rowset_delete_bitmap(
-                            _input_rowsets, _rowid_conversion, 0, UINT64_MAX, 
&missed_rows,
-                            &location_map, *it.delete_bitmap.get(), 
&txn_output_delete_bitmap);
-                    if (config::enable_merge_on_write_correctness_check) {
-                        RowsetIdUnorderedSet rowsetids;
-                        rowsetids.insert(_output_rowset->rowset_id());
-                        
_tablet->add_sentinel_mark_to_delete_bitmap(&txn_output_delete_bitmap,
-                                                                    rowsetids);
-                    }
-                    it.delete_bitmap->merge(txn_output_delete_bitmap);
-                    // Step3: write back updated delete bitmap and tablet info.
-                    it.rowset_ids.insert(_output_rowset->rowset_id());
-                    
StorageEngine::instance()->txn_manager()->set_txn_related_delete_bitmap(
-                            it.partition_id, it.transaction_id, 
_tablet->tablet_id(),
-                            _tablet->tablet_uid(), true, it.delete_bitmap, 
it.rowset_ids, nullptr);
                 }
+                DeleteBitmap txn_output_delete_bitmap(_tablet->tablet_id());
+                _tablet->calc_compaction_output_rowset_delete_bitmap(
+                        _input_rowsets, _rowid_conversion, 0, UINT64_MAX, 
&missed_rows,
+                        &location_map, *it.delete_bitmap.get(), 
&txn_output_delete_bitmap);
+                if (config::enable_merge_on_write_correctness_check) {
+                    RowsetIdUnorderedSet rowsetids;
+                    rowsetids.insert(_output_rowset->rowset_id());
+                    
_tablet->add_sentinel_mark_to_delete_bitmap(&txn_output_delete_bitmap,
+                                                                rowsetids);
+                }
+                it.delete_bitmap->merge(txn_output_delete_bitmap);
+                // Step3: write back updated delete bitmap and tablet info.
+                it.rowset_ids.insert(_output_rowset->rowset_id());
+                
StorageEngine::instance()->txn_manager()->set_txn_related_delete_bitmap(
+                        it.partition_id, it.transaction_id, 
_tablet->tablet_id(),
+                        _tablet->tablet_uid(), true, it.delete_bitmap, 
it.rowset_ids,
+                        it.partial_update_info);
             }
 
             // Convert the delete bitmap of the input rowsets to output rowset 
for
diff --git a/be/src/olap/txn_manager.cpp b/be/src/olap/txn_manager.cpp
index af6b0d67235..4198d756326 100644
--- a/be/src/olap/txn_manager.cpp
+++ b/be/src/olap/txn_manager.cpp
@@ -675,11 +675,14 @@ void TxnManager::get_all_commit_tablet_txn_info_by_tablet(
                 const RowsetSharedPtr& rowset = tablet_load_it->second.rowset;
                 const DeleteBitmapPtr& delete_bitmap = 
tablet_load_it->second.delete_bitmap;
                 const RowsetIdUnorderedSet& rowset_ids = 
tablet_load_it->second.rowset_ids;
+                const std::shared_ptr<PartialUpdateInfo> partial_update_info =
+                        tablet_load_it->second.partial_update_info;
                 if (!rowset || !delete_bitmap) {
                     continue;
                 }
-                commit_tablet_txn_info_vec->push_back(CommitTabletTxnInfo(
-                        partition_id, transaction_id, delete_bitmap, 
rowset_ids));
+                commit_tablet_txn_info_vec->push_back(
+                        CommitTabletTxnInfo(partition_id, transaction_id, 
delete_bitmap, rowset_ids,
+                                            partial_update_info));
             }
         }
     }
diff --git a/be/src/olap/txn_manager.h b/be/src/olap/txn_manager.h
index b5a1db0b46e..9fa146710c0 100644
--- a/be/src/olap/txn_manager.h
+++ b/be/src/olap/txn_manager.h
@@ -101,15 +101,18 @@ struct TabletTxnInfo {
 
 struct CommitTabletTxnInfo {
     CommitTabletTxnInfo(TPartitionId partition_id, TTransactionId 
transaction_id,
-                        DeleteBitmapPtr delete_bitmap, RowsetIdUnorderedSet 
rowset_ids)
+                        DeleteBitmapPtr delete_bitmap, RowsetIdUnorderedSet 
rowset_ids,
+                        std::shared_ptr<PartialUpdateInfo> partial_update_info)
             : transaction_id(transaction_id),
               partition_id(partition_id),
               delete_bitmap(delete_bitmap),
-              rowset_ids(rowset_ids) {}
+              rowset_ids(rowset_ids),
+              partial_update_info(partial_update_info) {}
     TTransactionId transaction_id;
     TPartitionId partition_id;
     DeleteBitmapPtr delete_bitmap;
     RowsetIdUnorderedSet rowset_ids;
+    std::shared_ptr<PartialUpdateInfo> partial_update_info;
 };
 
 using CommitTabletTxnInfoVec = std::vector<CommitTabletTxnInfo>;


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

Reply via email to