Skip to content

Reduce/downgrade some MPPTask logs#10821

Merged
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
gengliqi:reduce-logs
Apr 28, 2026
Merged

Reduce/downgrade some MPPTask logs#10821
ti-chi-bot[bot] merged 4 commits into
pingcap:masterfrom
gengliqi:reduce-logs

Conversation

@gengliqi
Copy link
Copy Markdown
Contributor

@gengliqi gengliqi commented Apr 24, 2026

What problem does this PR solve?

Issue Number: close #10820

Problem Summary:

What is changed and how it works?

Reduce some MPPTask logs

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Summary by CodeRabbit

  • Monitoring & Diagnostics
    • Refined task execution timing logging with dynamic priority levels
    • Adjusted message priorities based on operation duration thresholds for improved diagnostic clarity

Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot Bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 24, 2026
@gengliqi gengliqi changed the title Reduce some MPPTask logs Reduce/downgrade some MPPTask logs Apr 24, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: df5e3217-3a55-4c9d-969d-a86dcdef5908

📥 Commits

Reviewing files that changed from the base of the PR and between cd281ae and 618614d.

📒 Files selected for processing (1)
  • dbms/src/Flash/Mpp/MPPTask.cpp

📝 Walkthrough

Walkthrough

The MPP components now implement more selective logging strategies. Dispatch completion messages in MPPHandler are downgraded to debug level, while MPPTask adjusts log priorities dynamically based on operation timing thresholds and removes redundant runtime reporting from destructor logging.

Changes

Cohort / File(s) Summary
MPPHandler Logging Adjustment
dbms/src/Flash/Mpp/MPPHandler.cpp
Dispatch completion timing message downgraded from info to debug level.
MPPTask Logging Refinement
dbms/src/Flash/Mpp/MPPTask.cpp
Destructor removes total runtime logging; unregisterTask() measures and logs elapsed time with dynamic priority based on 1000ms threshold; runImpl() switches to dynamic log priority computed from combined schedule/preprocess time.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit hops through logs so vast,
Trimming noise from present and past,
With timers set at thresholds keen, 🐰
Debug shines where INFO's been,
Silence flows, the code's more clean!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Reduce/downgrade some MPPTask logs' directly and clearly summarizes the main change in the PR.
Description check ✅ Passed The PR description follows the template with all required sections completed, including the linked issue, commit message, test checklist, and release note.
Linked Issues check ✅ Passed The code changes reduce logging in MPPHandler.cpp and MPPTask.cpp by downgrading log levels, which directly addresses the issue #10820's objective to reduce MPPTask log volume.
Out of Scope Changes check ✅ Passed All changes are scoped to reducing log levels in MPPTask-related files, with no unrelated modifications or side effects introduced.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
dbms/src/Flash/Mpp/MPPTask.cpp (1)

158-158: Destructor finish log downgraded; note that total run-time is now only DEBUG-level.

Downgrading the destructor log to DEBUG is fine for reducing noise. Just be aware the only remaining emission of total_run_time_ms is the DEBUG log at Line 789 ("task ends, time cost is {} ms."), so at the default INFO log level operators will no longer see per-task run-time. If you still want quick visibility for long-running tasks, consider applying the same duration-threshold LOG_IMPL pattern you used in unregisterTask at Line 789 (e.g., INFO if total_run_time_ms > threshold, DEBUG otherwise). Otherwise, LGTM.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dbms/src/Flash/Mpp/MPPTask.cpp` at line 158, The destructor's finish log
(LOG_DEBUG in MPPTask:: ~MPPTask or finish function where LOG_DEBUG(log, "finish
MPPTask: {}", id.toString()) is emitted) currently only logs at DEBUG so
total_run_time_ms is only visible at DEBUG; update the destructor's logging to
use the same duration-threshold LOG_IMPL pattern used in unregisterTask (the
code around unregisterTask that checks total_run_time_ms against a threshold and
emits INFO when > threshold, DEBUG otherwise) so that long-running tasks still
emit INFO with the total_run_time_ms while short runs remain DEBUG; locate the
LOG_DEBUG call for finish MPPTask and replace it with the threshold-based
LOG_IMPL/conditional that references total_run_time_ms and the same threshold
variable/logic used in unregisterTask.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@dbms/src/Flash/Mpp/MPPTask.cpp`:
- Line 158: The destructor's finish log (LOG_DEBUG in MPPTask:: ~MPPTask or
finish function where LOG_DEBUG(log, "finish MPPTask: {}", id.toString()) is
emitted) currently only logs at DEBUG so total_run_time_ms is only visible at
DEBUG; update the destructor's logging to use the same duration-threshold
LOG_IMPL pattern used in unregisterTask (the code around unregisterTask that
checks total_run_time_ms against a threshold and emits INFO when > threshold,
DEBUG otherwise) so that long-running tasks still emit INFO with the
total_run_time_ms while short runs remain DEBUG; locate the LOG_DEBUG call for
finish MPPTask and replace it with the threshold-based LOG_IMPL/conditional that
references total_run_time_ms and the same threshold variable/logic used in
unregisterTask.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cb5c07ca-a2fe-4f7f-90ac-b249149f46a0

📥 Commits

Reviewing files that changed from the base of the PR and between 0dc254b and 89f9b94.

📒 Files selected for processing (3)
  • dbms/src/Flash/Mpp/MPPHandler.cpp
  • dbms/src/Flash/Mpp/MPPTask.cpp
  • dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp

u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
current_memory_tracker = query_memory_tracker;
abortTunnels("", true);
LOG_INFO(log, "finish MPPTask: {}, total run time is {} ms", id.toString(), total_run_time_ms);
LOG_DEBUG(log, "finish MPPTask: {}", id.toString());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why delete total_run_time?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because the total_run_time_ms has already printed in this debug log LOG_DEBUG(log, "task ends, time cost is {} ms.", total_run_time_ms);

u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
@gengliqi gengliqi requested a review from windtalker April 28, 2026 04:16
{
schedule();
LOG_INFO(log, "Event is scheduled");
LOG_DEBUG(log, "Event is scheduled");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log should use info level

u
Signed-off-by: gengliqi <gengliqiii@gmail.com>
Copy link
Copy Markdown
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot ti-chi-bot Bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Apr 28, 2026
Copy link
Copy Markdown
Contributor

@xzhangxian1008 xzhangxian1008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 28, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: windtalker, xzhangxian1008

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot Bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Apr 28, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 28, 2026

[LGTM Timeline notifier]

Timeline:

  • 2026-04-28 05:33:40.098374613 +0000 UTC m=+2662425.303734670: ☑️ agreed by windtalker.
  • 2026-04-28 05:58:06.380323131 +0000 UTC m=+2663891.585683188: ☑️ agreed by xzhangxian1008.

@ti-chi-bot ti-chi-bot Bot merged commit 830b296 into pingcap:master Apr 28, 2026
8 of 10 checks passed
@gengliqi
Copy link
Copy Markdown
Contributor Author

/cherrypick release-8.5

@gengliqi gengliqi deleted the reduce-logs branch May 28, 2026 11:15
@ti-chi-bot
Copy link
Copy Markdown
Member

@gengliqi: new pull request created to branch release-8.5: #10874.
But this PR has conflicts, please resolve them!

Details

In response to this:

/cherrypick release-8.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

ti-chi-bot Bot pushed a commit that referenced this pull request Jun 2, 2026
close #10820\n\nReduce some MPPTask logs\n\nSigned-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>\nSigned-off-by: gengliqi <gengliqiii@gmail.com>\n\nCo-authored-by: Liqi Geng <gengliqiii@gmail.com>\nCo-authored-by: gengliqi <gengliqiii@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce some MPPTask logs

4 participants