Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyiZzz committed Apr 19, 2024
1 parent cc65ed4 commit d24486c
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
6 changes: 6 additions & 0 deletions be/src/olap/base_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Status BaseCompaction::execute_compact() {

RETURN_IF_ERROR(CompactionMixin::execute_compact());
DCHECK_EQ(_state, CompactionState::SUCCESS);
LOG(WARNING) << "execute_compact111111 222 1 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

tablet()->set_last_base_compaction_success_time(UnixMillis());
DorisMetrics::instance()->base_compaction_deltas_total->increment(_input_rowsets.size());
Expand Down
48 changes: 48 additions & 0 deletions be/src/olap/compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,16 +394,34 @@ Status CompactionMixin::execute_compact() {
_input_rowsets.back()->end_version(), &checksum_before);
RETURN_IF_ERROR(checksum_task.execute());
}
LOG(WARNING) << "execute_compact111111 222 5 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

auto* data_dir = tablet()->data_dir();
int64_t permits = get_compaction_permits();
data_dir->disks_compaction_score_increment(permits);
data_dir->disks_compaction_num_increment(1);

LOG(WARNING) << "execute_compact111111 222 8 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();
Status st = execute_compact_impl(permits);

data_dir->disks_compaction_score_increment(-permits);
data_dir->disks_compaction_num_increment(-1);
LOG(WARNING) << "execute_compact111111 222 6 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

if (!st.ok()) {
return st;
Expand All @@ -421,11 +439,23 @@ Status CompactionMixin::execute_compact() {
}

_load_segment_to_cache();
LOG(WARNING) << "execute_compact111111 222 7 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();
return Status::OK();
}

Status CompactionMixin::execute_compact_impl(int64_t permits) {
OlapStopWatch watch;
LOG(WARNING) << "execute_compact111111 222 12 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

if (handle_ordered_data_compaction()) {
RETURN_IF_ERROR(modify_rowsets());
Expand All @@ -441,17 +471,35 @@ Status CompactionMixin::execute_compact_impl(int64_t permits) {
return Status::OK();
}
build_basic_info();
LOG(WARNING) << "execute_compact111111 222 10 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

VLOG_DEBUG << "dump tablet schema: " << _cur_tablet_schema->dump_structure();

LOG(INFO) << "start " << compaction_name() << ". tablet=" << _tablet->tablet_id()
<< ", output_version=" << _output_version << ", permits: " << permits;

RETURN_IF_ERROR(merge_input_rowsets());
LOG(WARNING) << "execute_compact111111 222 11 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

RETURN_IF_ERROR(do_inverted_index_compaction());

RETURN_IF_ERROR(modify_rowsets());
LOG(WARNING) << "execute_compact111111 222 9 " << _mem_tracker << ", "
<< _mem_tracker.use_count() << ", " << _mem_tracker->label() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker() << ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker().use_count()
<< ", "
<< thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker()->label();

auto* cumu_policy = tablet()->cumulative_compaction_policy();
DCHECK(cumu_policy);
Expand Down

0 comments on commit d24486c

Please sign in to comment.