-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[feat](profile) add automatic profile archiving to compressed ZIP files #57575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
peterylh
wants to merge
2
commits into
apache:master
Choose a base branch
from
peterylh:profile-archive
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,194
−17
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-DS: Total hot run time: 189517 ms |
ClickBench: Total hot run time: 27.5 s |
FE UT Coverage ReportIncrement line coverage |
|
run buildall |
ClickBench: Total hot run time: 29.43 s |
FE Regression Coverage ReportIncrement line coverage |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Profile Archive Feature
Summary
Add automatic profile archiving feature to preserve query profiles beyond current memory and disk limits. When profile storage reaches capacity, old profiles are automatically archived to compressed ZIP files instead of being deleted, enabling long-term profile retention for troubleshooting and analysis.
Problem
Currently, Doris has strict limits on profile storage:
max_query_profile_num)max_spilled_profile_num)spilled_profile_storage_limit_bytes)When these limits are exceeded, old profiles are permanently deleted, making it impossible to analyze historical slow queries beyond the retention window. This is problematic for:
Solution
Implement an automatic profile archiving system that:
Key Features
archive/pending/before archiving to ensure optimal batch sizesImplementation Details
Directory Structure
Archive File Naming
Archive ZIPs follow the naming pattern:
profiles_{start_timestamp}_{end_timestamp}.zipstart_timestamp: Earliest profile in the batch (YYYYMMDD_HHMMSS)end_timestamp: Latest profile in the batch (YYYYMMDD_HHMMSS)This enables quick location of profiles by query time.
Workflow
Code Changes
New Files:
ProfileArchiveManager.java(682 lines) - Core archiving logicModified Files:
Config.java(+35 lines) - Configuration parametersProfileManager.java(+157/-17 lines) - Integration with archive systemTest Files:
ProfileArchiveManagerTest.java(+1111 lines) - 26 comprehensive test casesProfileManagerTest.java(+227 lines) - Integration testsConfiguration
All parameters have sensible defaults and can be tuned via FE configuration:
enable_profile_archivetrueprofile_archive_batch_size100profile_archive_path""${spilled_profile_storage_path}/archive)profile_archive_retention_seconds604800-1for unlimited retention,0to disable archivingprofile_archive_pending_timeout_seconds86400Configuration Examples
Usage
For System Administrators
Step 1: Locate Slow Query
Step 2: Find Archive File
Step 3: Extract and Analyze
Space Management
Backward Compatibility
enable_profile_archive = falseto restore old behaviorCheck List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)