Skip to content

Reduce/downgrade some MPPTask logs#10821

Open
gengliqi wants to merge 2 commits intopingcap:masterfrom
gengliqi:reduce-logs
Open

Reduce/downgrade some MPPTask logs#10821
gengliqi wants to merge 2 commits intopingcap: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

  • Chores
    • Reduced verbosity by downgrading several informational logs to debug to keep production logs cleaner.
    • Task shutdown/unregister now records elapsed time and elevates log priority when operations are slow.
    • Task start logging now chooses priority based on recent timing metrics while keeping existing timing details.

Signed-off-by: gengliqi <gengliqiii@gmail.com>
@ti-chi-bot ti-chi-bot Bot added the release-note-none Denotes a PR that doesn't merit a release note. label Apr 24, 2026
@ti-chi-bot
Copy link
Copy Markdown
Contributor

ti-chi-bot Bot commented Apr 24, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign solotzg for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label 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: 6e442a63-0b7f-43bf-9122-8a7e0c00f906

📥 Commits

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

📒 Files selected for processing (1)
  • dbms/src/Flash/Mpp/MPPTask.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • dbms/src/Flash/Mpp/MPPTask.cpp

📝 Walkthrough

Walkthrough

Logging verbosity reduced across Flash MPP components: several INFO logs downgraded to DEBUG; MPPTask adds timing around unregisterTask and uses dynamic log priority based on elapsed durations, plus dynamic startup log priority.

Changes

Cohort / File(s) Summary
MPP Handler & Task
dbms/src/Flash/Mpp/MPPHandler.cpp, dbms/src/Flash/Mpp/MPPTask.cpp
Downgraded dispatch completion and task-finish logs from INFO to DEBUG. In MPPTask: measure manager->unregisterTask with a Stopwatch, include elapsed ms in logs, choose log priority based on 1000 ms threshold, and use dynamic priority for runImpl start logging (threshold on schedule+preprocess time). Minor log-level variable cleanup.
Pipeline Event
dbms/src/Flash/Pipeline/Schedule/Events/Event.cpp
Downgraded "Event is scheduled" log from INFO to DEBUG; no functional changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 Soft paws across the code I tread,

I hush the chatter, calm the thread.
Timers whisper, thresholds glow,
Debug now speaks where loud logs go.
A quieter hop — the runtime’s glad to know.

🚥 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 accurately describes the main change: downgrading log levels for several MPPTask-related logs to reduce verbosity.
Description check ✅ Passed The PR description follows the template with issue reference, commit message, completed test checklist (No code), and release note properly filled.
Linked Issues check ✅ Passed The code changes directly address issue #10820 by reducing MPPTask logs through downgrading log levels from INFO to DEBUG and adding dynamic priority logic.
Out of Scope Changes check ✅ Passed All changes are focused on reducing log verbosity in MPP-related files; no unrelated functionality modifications or out-of-scope changes detected.

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

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

1 participant