Skip to content

Commit f065053

Browse files
authored
Merge branch 'master' into show-columns-hide-version
2 parents 6a10ddb + e723190 commit f065053

File tree

926 files changed

+29367
-15970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

926 files changed

+29367
-15970
lines changed

.github/workflows/auto-cherry-pick.yml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ permissions:
3131
jobs:
3232
auto_cherry_pick:
3333
runs-on: ubuntu-latest
34-
if: ${{(contains(github.event.pull_request.labels.*.name, 'dev/4.0.x') || contains(github.event.pull_request.labels.*.name, 'dev/3.1.x') || github.event.label.name == 'dev/4.0.x' || github.event.label.name == 'dev/3.1.x') && github.event.pull_request.merged == true }}
34+
if: ${{(contains(github.event.pull_request.labels.*.name, 'dev/4.0.x') || github.event.label.name == 'dev/4.0.x') && github.event.pull_request.merged == true }}
3535
steps:
3636
- name: Checkout repository
3737
uses: actions/checkout@v3
@@ -54,14 +54,7 @@ jobs:
5454
else
5555
echo "SHA matches: $calculated_sha"
5656
fi
57-
- name: Auto cherry-pick to branch-3.1
58-
if: ${{ ((github.event.action == 'labeled' && github.event.label.name == 'dev/3.1.x'))|| ((github.event_name == 'pull_request_target' && github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'dev/3.1.x')) }}
59-
env:
60-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
REPO_NAME: ${{ github.repository }}
62-
CONFLICT_LABEL: dev/3.1.x-conflict
63-
run: |
64-
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-3.1
57+
6558
- name: Auto cherry-pick to branch-4.0
6659
if: ${{ ((github.event.action == 'labeled' && github.event.label.name == 'dev/4.0.x'))|| ((github.event_name == 'pull_request_target' && github.event.action == 'closed') && contains(github.event.pull_request.labels.*.name, 'dev/4.0.x')) }}
6760
env:

NOTICE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Apache Doris
2-
Copyright 2018-2025 The Apache Software Foundation
2+
Copyright 2018-2026 The Apache Software Foundation
33

44
This product includes software developed at
55
The Apache Software Foundation (http://www.apache.org/).

be/src/agent/cgroup_cpu_ctl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,11 @@ Status CgroupCpuCtl::write_cg_sys_file(std::string file_path, std::string value,
234234
auto str = fmt::format("{}\n", value);
235235
ssize_t ret = write(fd, str.c_str(), str.size());
236236
if (ret == -1) {
237-
LOG(ERROR) << msg << " write sys file failed";
238-
return Status::InternalError<false>("{} write sys file failed", msg);
237+
LOG(ERROR) << msg << " write sys file failed, file_path=" << file_path;
238+
return Status::InternalError<false>("{} write sys file failed, file_path={}", msg,
239+
file_path);
239240
}
240-
LOG(INFO) << msg << " success";
241+
LOG(INFO) << msg << " success, file path: " << file_path;
241242
return Status::OK();
242243
}
243244

be/src/cloud/cloud_engine_calc_delete_bitmap_task.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,12 @@ Status CloudTabletCalcDeleteBitmapTask::handle() const {
224224
});
225225
Status status;
226226
if (_sub_txn_ids.empty()) {
227+
// Check empty rowset for non-sub_txn case
228+
if (_engine.txn_delete_bitmap_cache().is_empty_rowset(_transaction_id, _tablet_id)) {
229+
LOG(INFO) << "tablet=" << _tablet_id << ", txn=" << _transaction_id
230+
<< " is empty rowset, skip delete bitmap calculation";
231+
return Status::OK();
232+
}
227233
status = _handle_rowset(tablet, _version);
228234
} else {
229235
std::stringstream ss;
@@ -237,9 +243,18 @@ Status CloudTabletCalcDeleteBitmapTask::handle() const {
237243
std::vector<RowsetSharedPtr> invisible_rowsets;
238244
DeleteBitmapPtr tablet_delete_bitmap =
239245
std::make_shared<DeleteBitmap>(tablet->tablet_meta()->delete_bitmap());
240-
for (int i = 0; i < _sub_txn_ids.size(); ++i) {
246+
size_t empty_rowset_count = 0;
247+
for (size_t i = 0; i < _sub_txn_ids.size(); ++i) {
241248
int64_t sub_txn_id = _sub_txn_ids[i];
242249
int64_t version = _version + i;
250+
// Check empty rowset for each sub_txn using sub_txn_id
251+
if (_engine.txn_delete_bitmap_cache().is_empty_rowset(sub_txn_id, _tablet_id)) {
252+
LOG(INFO) << "tablet=" << _tablet_id << ", sub_txn=" << sub_txn_id
253+
<< ", version=" << version
254+
<< " is empty rowset, skip delete bitmap calculation";
255+
empty_rowset_count++;
256+
continue;
257+
}
243258
LOG(INFO) << "start calc delete bitmap for txn_id=" << _transaction_id
244259
<< ", sub_txn_id=" << sub_txn_id << ", table_id=" << tablet->table_id()
245260
<< ", partition_id=" << tablet->partition_id() << ", tablet_id=" << _tablet_id
@@ -254,7 +269,7 @@ Status CloudTabletCalcDeleteBitmapTask::handle() const {
254269
<< ", cur_version=" << version << ", status=" << status;
255270
return status;
256271
}
257-
DCHECK(invisible_rowsets.size() == i + 1);
272+
DCHECK(invisible_rowsets.size() == i + 1 - empty_rowset_count);
258273
}
259274
}
260275
DBUG_EXECUTE_IF("CloudCalcDbmTask.handle.return.block",

be/src/cloud/cloud_rowset_builder.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,15 @@ const RowsetMetaSharedPtr& CloudRowsetBuilder::rowset_meta() {
127127

128128
Status CloudRowsetBuilder::set_txn_related_delete_bitmap() {
129129
if (_tablet->enable_unique_key_merge_on_write()) {
130+
// For empty rowsets when skip_writing_empty_rowset_metadata=true,
131+
// store only a lightweight marker instead of full rowset info.
132+
// This allows CalcDeleteBitmapTask to detect and skip gracefully,
133+
// while using minimal memory (~16 bytes per entry).
134+
if (_skip_writing_rowset_metadata) {
135+
_engine.txn_delete_bitmap_cache().mark_empty_rowset(_req.txn_id, _tablet->tablet_id(),
136+
_req.txn_expiration);
137+
return Status::OK();
138+
}
130139
if (config::enable_merge_on_write_correctness_check && _rowset->num_rows() != 0) {
131140
auto st = _tablet->check_delete_bitmap_correctness(
132141
_delete_bitmap, _rowset->end_version() - 1, _req.txn_id, *_rowset_ids);

be/src/cloud/cloud_txn_delete_bitmap_cache.cpp

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ void CloudTxnDeleteBitmapCache::remove_expired_tablet_txn_info() {
231231
std::unique_lock<std::shared_mutex> wlock(_rwlock);
232232
while (!_expiration_txn.empty()) {
233233
auto iter = _expiration_txn.begin();
234-
if (_txn_map.find(iter->second) == _txn_map.end()) {
234+
bool in_txn_map = _txn_map.find(iter->second) != _txn_map.end();
235+
bool in_markers = _empty_rowset_markers.find(iter->second) != _empty_rowset_markers.end();
236+
if (!in_txn_map && !in_markers) {
235237
_expiration_txn.erase(iter);
236238
continue;
237239
}
@@ -241,6 +243,7 @@ void CloudTxnDeleteBitmapCache::remove_expired_tablet_txn_info() {
241243
if (iter->first > current_time) {
242244
break;
243245
}
246+
// Clean from _txn_map if exists
244247
auto txn_iter = _txn_map.find(iter->second);
245248
if ((txn_iter != _txn_map.end()) && (iter->first == txn_iter->second.txn_expiration)) {
246249
LOG_INFO("clean expired delete bitmap")
@@ -253,6 +256,14 @@ void CloudTxnDeleteBitmapCache::remove_expired_tablet_txn_info() {
253256
erase(cache_key);
254257
_txn_map.erase(iter->second);
255258
}
259+
// Clean from _empty_rowset_markers if exists
260+
auto marker_iter = _empty_rowset_markers.find(iter->second);
261+
if (marker_iter != _empty_rowset_markers.end()) {
262+
LOG_INFO("clean expired empty rowset marker")
263+
.tag("txn_id", iter->second.txn_id)
264+
.tag("tablet_id", iter->second.tablet_id);
265+
_empty_rowset_markers.erase(marker_iter);
266+
}
256267
_expiration_txn.erase(iter);
257268
}
258269
}
@@ -274,6 +285,32 @@ void CloudTxnDeleteBitmapCache::remove_unused_tablet_txn_info(TTransactionId tra
274285
}
275286
}
276287

288+
void CloudTxnDeleteBitmapCache::mark_empty_rowset(TTransactionId txn_id, int64_t tablet_id,
289+
int64_t txn_expiration) {
290+
int64_t txn_expiration_min =
291+
duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch())
292+
.count() +
293+
config::tablet_txn_info_min_expired_seconds;
294+
txn_expiration = std::max(txn_expiration_min, txn_expiration);
295+
296+
if (config::enable_mow_verbose_log) {
297+
LOG_INFO("mark empty rowset")
298+
.tag("txn_id", txn_id)
299+
.tag("tablet_id", tablet_id)
300+
.tag("expiration", txn_expiration);
301+
}
302+
std::unique_lock<std::shared_mutex> wlock(_rwlock);
303+
TxnKey txn_key(txn_id, tablet_id);
304+
_empty_rowset_markers.emplace(txn_key);
305+
_expiration_txn.emplace(txn_expiration, txn_key);
306+
}
307+
308+
bool CloudTxnDeleteBitmapCache::is_empty_rowset(TTransactionId txn_id, int64_t tablet_id) {
309+
std::shared_lock<std::shared_mutex> rlock(_rwlock);
310+
TxnKey txn_key(txn_id, tablet_id);
311+
return _empty_rowset_markers.contains(txn_key);
312+
}
313+
277314
void CloudTxnDeleteBitmapCache::_clean_thread_callback() {
278315
do {
279316
remove_expired_tablet_txn_info();

be/src/cloud/cloud_txn_delete_bitmap_cache.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ class CloudTxnDeleteBitmapCache : public LRUCachePolicy {
5959

6060
void remove_unused_tablet_txn_info(TTransactionId transaction_id, int64_t tablet_id);
6161

62+
// Mark a rowset as empty/skipped (lightweight marker, no rowset stored)
63+
// Used for empty rowsets when skip_writing_empty_rowset_metadata is enabled
64+
void mark_empty_rowset(TTransactionId txn_id, int64_t tablet_id, int64_t txn_expiration);
65+
66+
// Check if this is a known empty/skipped rowset
67+
// Returns true if was marked as empty rowset
68+
// Note: Does not remove the marker, as CalcDeleteBitmapTask may retry.
69+
// Cleanup is handled by expiration-based removal in remove_expired_tablet_txn_info()
70+
bool is_empty_rowset(TTransactionId txn_id, int64_t tablet_id);
71+
6272
// !!!ATTENTION!!!: the delete bitmap stored in CloudTxnDeleteBitmapCache contains sentinel marks,
6373
// and the version in BitmapKey is DeleteBitmap::TEMP_VERSION_COMMON.
6474
// when using delete bitmap from this cache, the caller should manually remove these marks if don't need it
@@ -107,6 +117,9 @@ class CloudTxnDeleteBitmapCache : public LRUCachePolicy {
107117

108118
std::map<TxnKey, TxnVal> _txn_map;
109119
std::multimap<int64_t, TxnKey> _expiration_txn;
120+
// Lightweight markers for empty/skipped rowsets (only stores TxnKey, ~16 bytes per entry)
121+
// Used to track empty rowsets that were not committed to meta-service
122+
std::set<TxnKey> _empty_rowset_markers;
110123
std::shared_mutex _rwlock;
111124
std::shared_ptr<Thread> _clean_thread;
112125
CountDownLatch _stop_latch;

be/src/cloud/config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ DEFINE_mInt64(warm_up_rowset_sync_wait_max_timeout_ms, "120000");
135135
DEFINE_mBool(enable_warmup_immediately_on_new_rowset, "false");
136136

137137
// Packed file manager config
138-
DEFINE_mBool(enable_packed_file, "true");
138+
DEFINE_mBool(enable_packed_file, "false");
139139
DEFINE_mInt64(packed_file_size_threshold_bytes, "5242880"); // 5MB
140140
DEFINE_mInt64(packed_file_time_threshold_ms, "100"); // 100ms
141141
DEFINE_mInt64(packed_file_try_lock_timeout_ms, "5"); // 5ms

be/src/cloud/pb_convert.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ void doris_rowset_meta_to_cloud(RowsetMetaCloudPB* out, const RowsetMetaPB& in)
8080
out->set_txn_expiration(in.txn_expiration());
8181
out->set_segments_overlap_pb(in.segments_overlap_pb());
8282
out->set_segments_key_bounds_truncated(in.segments_key_bounds_truncated());
83+
out->mutable_num_segment_rows()->CopyFrom(in.num_segment_rows());
8384
out->mutable_segments_file_size()->CopyFrom(in.segments_file_size());
8485
out->set_index_id(in.index_id());
8586
if (in.has_schema_version()) {
@@ -157,6 +158,7 @@ void doris_rowset_meta_to_cloud(RowsetMetaCloudPB* out, RowsetMetaPB&& in) {
157158
out->set_txn_expiration(in.txn_expiration());
158159
out->set_segments_overlap_pb(in.segments_overlap_pb());
159160
out->set_segments_key_bounds_truncated(in.segments_key_bounds_truncated());
161+
out->mutable_num_segment_rows()->Swap(in.mutable_num_segment_rows());
160162
out->mutable_segments_file_size()->Swap(in.mutable_segments_file_size());
161163
out->set_index_id(in.index_id());
162164
if (in.has_schema_version()) {
@@ -246,6 +248,7 @@ void cloud_rowset_meta_to_doris(RowsetMetaPB* out, const RowsetMetaCloudPB& in)
246248
out->set_txn_expiration(in.txn_expiration());
247249
out->set_segments_overlap_pb(in.segments_overlap_pb());
248250
out->set_segments_key_bounds_truncated(in.segments_key_bounds_truncated());
251+
out->mutable_num_segment_rows()->CopyFrom(in.num_segment_rows());
249252
out->mutable_segments_file_size()->CopyFrom(in.segments_file_size());
250253
out->set_index_id(in.index_id());
251254
if (in.has_schema_version()) {
@@ -323,6 +326,7 @@ void cloud_rowset_meta_to_doris(RowsetMetaPB* out, RowsetMetaCloudPB&& in) {
323326
out->set_txn_expiration(in.txn_expiration());
324327
out->set_segments_overlap_pb(in.segments_overlap_pb());
325328
out->set_segments_key_bounds_truncated(in.segments_key_bounds_truncated());
329+
out->mutable_num_segment_rows()->Swap(in.mutable_num_segment_rows());
326330
out->mutable_segments_file_size()->Swap(in.mutable_segments_file_size());
327331
out->set_index_id(in.index_id());
328332
if (in.has_schema_version()) {

be/src/common/config.cpp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,12 @@ DEFINE_mInt32(trash_file_expire_time_sec, "0");
384384
// modify them upon necessity
385385
DEFINE_Int32(min_file_descriptor_number, "60000");
386386
DEFINE_mBool(disable_segment_cache, "false");
387+
// Enable checking segment rows consistency between rowset meta and segment footer
388+
DEFINE_mBool(enable_segment_rows_consistency_check, "false");
389+
DEFINE_mBool(enable_segment_rows_check_core, "false");
390+
// ATTENTION: For test only. In test environment, there are no historical data,
391+
// so all rowset meta should have segment rows info.
392+
DEFINE_mBool(fail_when_segment_rows_not_in_rowset_meta, "false");
387393
DEFINE_String(row_cache_mem_limit, "20%");
388394

389395
// Cache for storage page size
@@ -567,6 +573,14 @@ DEFINE_Bool(enable_all_http_auth, "false");
567573
// Number of webserver workers
568574
DEFINE_Int32(webserver_num_workers, "128");
569575

576+
// Async replies: stream load only now
577+
// reply wait timeout only happens if:
578+
// 1. Stream load fragment execution times out
579+
// HTTP request freed → stream load canceled
580+
// 2. Client disconnects
581+
DEFINE_mInt32(async_reply_timeout_s, "60");
582+
DEFINE_Validator(async_reply_timeout_s, [](const int config) -> bool { return config >= 3; });
583+
570584
DEFINE_Bool(enable_single_replica_load, "true");
571585
// Number of download workers for single replica load
572586
DEFINE_Int32(single_replica_load_download_num_workers, "64");
@@ -1010,7 +1024,7 @@ DEFINE_mInt64(big_column_size_buffer, "65535");
10101024
DEFINE_mInt64(small_column_size_buffer, "100");
10111025

10121026
// Perform the always_true check at intervals determined by runtime_filter_sampling_frequency
1013-
DEFINE_mInt32(runtime_filter_sampling_frequency, "64");
1027+
DEFINE_mInt32(runtime_filter_sampling_frequency, "32");
10141028
DEFINE_mInt32(execution_max_rpc_timeout_sec, "3600");
10151029
DEFINE_mBool(execution_ignore_eovercrowded, "true");
10161030
// cooldown task configs
@@ -1234,7 +1248,7 @@ DEFINE_Int32(segment_cache_capacity, "-1");
12341248
DEFINE_Int32(segment_cache_fd_percentage, "20");
12351249
DEFINE_mInt32(estimated_mem_per_column_reader, "512");
12361250
DEFINE_Int32(segment_cache_memory_percentage, "5");
1237-
DEFINE_Bool(enable_segment_cache_prune, "true");
1251+
DEFINE_Bool(enable_segment_cache_prune, "false");
12381252

12391253
// enable feature binlog, default false
12401254
DEFINE_Bool(enable_feature_binlog, "false");
@@ -1599,18 +1613,7 @@ DEFINE_mInt64(max_csv_line_reader_output_buffer_size, "4294967296");
15991613
// Maximum number of OpenMP threads allowed for concurrent vector index builds.
16001614
// -1 means auto: use 80% of the available CPU cores.
16011615
DEFINE_Int32(omp_threads_limit, "-1");
1602-
DEFINE_Validator(omp_threads_limit, [](const int config) -> bool {
1603-
if (config > 0) {
1604-
omp_threads_limit = config;
1605-
return true;
1606-
}
1607-
CpuInfo::init();
1608-
int core_cap = config::num_cores > 0 ? config::num_cores : CpuInfo::num_cores();
1609-
core_cap = std::max(1, core_cap);
1610-
// Use at most 80% of the available CPU cores.
1611-
omp_threads_limit = std::max(1, core_cap * 4 / 5);
1612-
return true;
1613-
});
1616+
16141617
// The capacity of segment partial column cache, used to cache column readers for each segment.
16151618
DEFINE_mInt32(max_segment_partial_column_cache_size, "100");
16161619

@@ -2085,6 +2088,8 @@ Status set_fuzzy_configs() {
20852088
((distribution(*generator) % 2) == 0) ? "10" : "4294967295";
20862089
fuzzy_field_and_value["skip_writing_empty_rowset_metadata"] =
20872090
((distribution(*generator) % 2) == 0) ? "true" : "false";
2091+
fuzzy_field_and_value["enable_packed_file"] =
2092+
((distribution(*generator) % 2) == 0) ? "true" : "false";
20882093
fuzzy_field_and_value["max_segment_partial_column_cache_size"] =
20892094
((distribution(*generator) % 2) == 0) ? "5" : "10";
20902095

0 commit comments

Comments
 (0)