[fix](dynamic partition) Fix timezone mismatch in hot partition cooldown time computation#62529
Open
shuke987 wants to merge 1 commit intoapache:branch-4.1from
Open
[fix](dynamic partition) Fix timezone mismatch in hot partition cooldown time computation#62529shuke987 wants to merge 1 commit intoapache:branch-4.1from
shuke987 wants to merge 1 commit intoapache:branch-4.1from
Conversation
…own time computation setStorageMediumProperty formats the cooldown time string using the partition's timezone (via getPartitionRangeString with DATETIME_FORMAT), but analyzeDataProperty parses it using the FE server timezone (TimeUtils.getTimeZone). When these differ, the cooldown time shifts by the timezone offset (up to ±15 hours), which can push it into the past and trigger "Cool down time should later than now" error. Fix: parse the partition-timezone string back to a ZonedDateTime with the correct zone, convert to epoch millis, then re-format using TimeUtils.longToTimeString() which uses the FE timezone — matching what analyzeDataProperty expects. Closes DORIS-25127 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Collaborator
Author
|
run buildall |
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
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.
Summary
DynamicPartitionScheduler.setStorageMediumPropertyformats cooldown time in partition timezone butPropertyAnalyzer.analyzeDataPropertyparses it in FE server timezone — classic implicit-timezone bugdynamic_partition.time_zonediffers from FE timezone (e.g.,Europe/LondonvsCST), cooldown time shifts by the offset (up to ±15h), causing intermittentCool down time should later than nowerrorZonedDateTimewith correct zone → epoch ms →TimeUtils.longToTimeString()(FE timezone), matching whatanalyzeDataPropertyexpectsChanges
DynamicPartitionScheduler.java: 10-line fix insetStorageMediumPropertyelse branchDynamicPartitionTableTest.java: 3 new test cases covering:Each test independently computes the expected cooldown epoch and asserts ≤1h deviation — catches the 8-15h timezone shift regardless of when the test runs.
Closes DORIS-25127
Test plan
DynamicPartitionTableTest.testHotPartitionCooldownTimeWithNonDefaultTimezone🤖 Generated with Claude Code