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 f300a14f09e [Fix](partial update) Fix partial update info loss when
the delete bitmaps of the committed transactions are calculated by the
compaction #26556 (#26735)
f300a14f09e is described below
commit f300a14f09e31d2fef227bdf12aab4fea02ab8e5
Author: bobhan1 <[email protected]>
AuthorDate: Fri Nov 10 21:58:52 2023 +0800
[Fix](partial update) Fix partial update info loss when the delete bitmaps
of the committed transactions are calculated by the compaction #26556 (#26735)
---
be/src/olap/compaction.cpp | 35 +++++++++++++++++------------------
be/src/olap/txn_manager.cpp | 7 +++++--
be/src/olap/txn_manager.h | 7 +++++--
3 files changed, 27 insertions(+), 22 deletions(-)
diff --git a/be/src/olap/compaction.cpp b/be/src/olap/compaction.cpp
index ec781e25a68..2a0dc209fb3 100644
--- a/be/src/olap/compaction.cpp
+++ b/be/src/olap/compaction.cpp
@@ -719,25 +719,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->schema_hash(), _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->schema_hash(), _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 93ba206af0e..7d4e1757252 100644
--- a/be/src/olap/txn_manager.cpp
+++ b/be/src/olap/txn_manager.cpp
@@ -638,11 +638,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 2cbb9509383..7483b9ff37e 100644
--- a/be/src/olap/txn_manager.h
+++ b/be/src/olap/txn_manager.h
@@ -82,15 +82,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: [email protected]
For additional commands, e-mail: [email protected]