You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2026/10/08 03:23:55 UTC
(doris) 24/35: branch-4.1: [fix](cloud) Respect recycle type when deleting partial update rowsets (#68594) (#68665)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.2
in repository https://gitbox.apache.org/repos/asf/doris.git
commit 810c92fb83612570a8759ae56d6795253929bc14
Author: Yixuan Wang <wa...@selectdb.com>
AuthorDate: Wed Sep 30 22:00:18 2026 +0800
branch-4.1: [fix](cloud) Respect recycle type when deleting partial update rowsets (#68594) (#68665)
pick: https://github.com/apache/doris/pull/68594
---
cloud/src/recycler/recycler.cpp | 2 +-
cloud/test/recycler_test.cpp | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/cloud/src/recycler/recycler.cpp b/cloud/src/recycler/recycler.cpp
index 7508dcf22d0..72a444f3da4 100644
--- a/cloud/src/recycler/recycler.cpp
+++ b/cloud/src/recycler/recycler.cpp
@@ -4432,7 +4432,7 @@ int InstanceRecycler::delete_rowset_data(
continue;
}
}
- if (rs.rowset_state() == RowsetStatePB::BEGIN_PARTIAL_UPDATE) {
+ if (rs.rowset_state() == RowsetStatePB::BEGIN_PARTIAL_UPDATE && !is_formal_rowset) {
// if rowset state is RowsetStatePB::BEGIN_PARTIAL_UPDATE, the number of segments data
// may be larger than num_segments field in RowsetMeta, so we need to delete the rowset's data by prefix
rowsets_delete_by_prefix.emplace_back(rs.resource_id(), tablet_id, rs.rowset_id_v2());
diff --git a/cloud/test/recycler_test.cpp b/cloud/test/recycler_test.cpp
index 1df08daed36..df64727ae9c 100644
--- a/cloud/test/recycler_test.cpp
+++ b/cloud/test/recycler_test.cpp
@@ -7350,6 +7350,40 @@ TEST(RecyclerTest, delete_rowset_data) {
}
}
+TEST(RecyclerTest, delete_partial_update_rowset_data_by_recycling_state) {
+ auto txn_kv = std::make_shared<MemTxnKv>();
+ ASSERT_EQ(txn_kv->init(), 0);
+
+ constexpr auto resource_id = "partial_update_delete";
+ InstanceInfoPB instance;
+ instance.set_instance_id(instance_id);
+ instance.add_obj_info()->set_id(resource_id);
+ InstanceRecycler recycler(txn_kv, instance, thread_group,
+ std::make_shared<TxnLazyCommitter>(txn_kv));
+ ASSERT_EQ(recycler.init(), 0);
+ auto accessor = recycler.accessor_map_.at(resource_id);
+
+ doris::TabletSchemaCloudPB schema;
+ schema.set_schema_version(1);
+ auto rowset = create_rowset(resource_id, 10001, 10002, 1, schema,
+ RowsetStatePB::BEGIN_PARTIAL_UPDATE);
+ const auto segment = segment_path(rowset.tablet_id(), rowset.rowset_id_v2(), 0);
+ const auto extra_segment = segment_path(rowset.tablet_id(), rowset.rowset_id_v2(), 1);
+ std::map<std::string, doris::RowsetMetaCloudPB> rowsets {{rowset.rowset_id_v2(), rowset}};
+
+ for (auto type : {RowsetRecyclingState::FORMAL_ROWSET, RowsetRecyclingState::TMP_ROWSET}) {
+ SCOPED_TRACE(static_cast<int>(type));
+ ASSERT_EQ(accessor->put_file(segment, ""), 0);
+ ASSERT_EQ(accessor->put_file(extra_segment, ""), 0);
+
+ RecyclerMetricsContext metrics_context;
+ ASSERT_EQ(recycler.delete_rowset_data(rowsets, type, metrics_context), 0);
+ EXPECT_EQ(accessor->exists(segment), 1);
+ EXPECT_EQ(accessor->exists(extra_segment),
+ type == RowsetRecyclingState::FORMAL_ROWSET ? 0 : 1);
+ }
+}
+
TEST(RecyclerTest, delete_rowset_data_without_delete_bitmap_meta) {
auto txn_kv = std::make_shared<MemTxnKv>();
ASSERT_EQ(txn_kv->init(), 0);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org