Skip to content

[fix](fe) Fix TIMESTAMPTZ dynamic partition boundaries not aligned to UTC midnight#65219

Draft
starocean999 wants to merge 5 commits into
apache:masterfrom
starocean999:master_0408
Draft

[fix](fe) Fix TIMESTAMPTZ dynamic partition boundaries not aligned to UTC midnight#65219
starocean999 wants to merge 5 commits into
apache:masterfrom
starocean999:master_0408

Conversation

@starocean999

Copy link
Copy Markdown
Contributor

Related PR: #64795

Problem Summary:
When a table has a TIMESTAMPTZ partition column and dynamic_partition.time_zone is set to a non-UTC timezone (e.g., Asia/Shanghai), the dynamically created partition boundaries are shifted to midnight in the configured timezone rather than UTC midnight.

Root cause: getAddPartitionOp() computed the current date (now) in the configured timezone, then convertToUtcTimestamp() interpreted the resulting date string as midnight in that timezone and converted it to UTC — producing a timezone-offset hour (e.g., 16:00) instead of UTC midnight (00:00). Both the now computation and the timezone used in convertToUtcTimestamp() needed to be fixed.

Fix

In DynamicPartitionScheduler.getAddPartitionOp(), decouple the time references for boundary computation and naming:

  1. Boundary computation: For TIMESTAMPTZ, use ZonedDateTime.now(UTC) for the current clock and pass UTC as the source timezone to convertToUtcTimestamp(). This ensures partition boundaries are at UTC midnight (00:00–24:00) regardless of dynamic_partition.time_zone.

  2. Partition naming: Keep using ZonedDateTime.now(configured_timezone) for generating prevBorderForName, so partition names remain identical to the pre-fix behavior. The dynamic_partition.time_zone property continues to control naming (e.g., week-of-year computation for week partitions).

  3. Storage properties: setStorageMediumProperty() and setStoragePolicyProperty() also use the configured-timezone nowTz so hot partition determination stays consistent with naming.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@starocean999

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Your access token could not be refreshed because your refresh token was already used. Please log out and sign in again.
Workflow run: https://github.com/apache/doris/actions/runs/28741409816

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 28634 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 575f715de7f3ca5549da68b50d192e326404f910, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17743	4002	3928	3928
q2	2036	316	193	193
q3	10320	1386	828	828
q4	4687	463	336	336
q5	7465	858	555	555
q6	169	167	133	133
q7	748	830	614	614
q8	9882	1409	1491	1409
q9	6166	4335	4377	4335
q10	6814	1759	1507	1507
q11	506	342	300	300
q12	744	541	443	443
q13	18073	3358	2758	2758
q14	281	263	241	241
q15	q16	779	770	705	705
q17	1929	1029	707	707
q18	6834	5730	5493	5493
q19	1471	1259	994	994
q20	790	643	517	517
q21	5714	2639	2346	2346
q22	435	357	292	292
Total cold run time: 103586 ms
Total hot run time: 28634 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4350	4240	4232	4232
q2	294	311	209	209
q3	4522	4928	4425	4425
q4	2006	2081	1364	1364
q5	4392	4294	4237	4237
q6	227	181	125	125
q7	1709	1957	1699	1699
q8	2436	2145	2045	2045
q9	7827	7740	7662	7662
q10	4720	4654	4251	4251
q11	573	404	391	391
q12	741	755	534	534
q13	3314	3571	3029	3029
q14	303	293	297	293
q15	q16	702	729	642	642
q17	1332	1328	1336	1328
q18	8001	7178	6907	6907
q19	1109	1072	1082	1072
q20	2208	2190	1925	1925
q21	5163	4492	4378	4378
q22	511	445	399	399
Total cold run time: 56440 ms
Total hot run time: 51147 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 172449 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 575f715de7f3ca5549da68b50d192e326404f910, data reload: false

query5	4309	643	489	489
query6	453	214	202	202
query7	4849	603	340	340
query8	336	185	166	166
query9	8768	4051	4002	4002
query10	479	364	283	283
query11	5940	2349	2138	2138
query12	157	106	101	101
query13	1329	579	452	452
query14	6265	5298	4981	4981
query14_1	4300	4310	4284	4284
query15	217	203	178	178
query16	986	477	441	441
query17	993	730	592	592
query18	2444	484	351	351
query19	215	192	156	156
query20	115	107	108	107
query21	237	162	147	147
query22	13565	13628	13378	13378
query23	17126	16459	16073	16073
query23_1	16125	16207	16188	16188
query24	7441	1838	1321	1321
query24_1	1321	1325	1294	1294
query25	581	466	393	393
query26	1345	350	207	207
query27	2596	596	381	381
query28	4468	2018	2030	2018
query29	1102	622	509	509
query30	337	261	229	229
query31	1115	1090	995	995
query32	107	64	59	59
query33	525	327	258	258
query34	1184	1200	665	665
query35	780	778	690	690
query36	1387	1433	1253	1253
query37	160	113	92	92
query38	1918	1727	1674	1674
query39	979	958	940	940
query39_1	914	906	916	906
query40	286	160	140	140
query41	68	64	63	63
query42	92	92	90	90
query43	330	329	290	290
query44	1528	813	808	808
query45	200	186	180	180
query46	1095	1251	708	708
query47	2367	2356	2233	2233
query48	399	426	291	291
query49	575	418	306	306
query50	1058	441	323	323
query51	4430	4366	4313	4313
query52	85	91	75	75
query53	260	275	205	205
query54	278	228	208	208
query55	79	71	70	70
query56	284	277	272	272
query57	1436	1386	1314	1314
query58	279	255	262	255
query59	1572	1642	1432	1432
query60	302	268	254	254
query61	157	147	147	147
query62	693	644	569	569
query63	243	205	203	203
query64	2535	764	596	596
query65	4855	4803	4767	4767
query66	1823	498	382	382
query67	29460	29382	28631	28631
query68	3263	1488	975	975
query69	407	305	270	270
query70	1062	965	939	939
query71	358	308	346	308
query72	2794	2607	2301	2301
query73	859	756	425	425
query74	5091	4949	4775	4775
query75	2608	2584	2222	2222
query76	2302	1213	796	796
query77	362	398	297	297
query78	12317	12331	11781	11781
query79	1481	1205	743	743
query80	1273	542	454	454
query81	539	330	280	280
query82	814	161	124	124
query83	358	326	292	292
query84	322	165	129	129
query85	968	591	528	528
query86	442	305	293	293
query87	1815	1814	1752	1752
query88	3800	2819	2806	2806
query89	462	419	357	357
query90	1865	203	200	200
query91	199	191	162	162
query92	62	61	57	57
query93	1889	1506	1016	1016
query94	740	381	297	297
query95	816	560	481	481
query96	1039	822	342	342
query97	2674	2680	2565	2565
query98	211	203	198	198
query99	1167	1151	1021	1021
Total cold run time: 259111 ms
Total hot run time: 172449 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 25.03 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 575f715de7f3ca5549da68b50d192e326404f910, data reload: false

query1	0.01	0.00	0.01
query2	0.10	0.05	0.06
query3	0.26	0.13	0.13
query4	1.61	0.13	0.14
query5	0.26	0.23	0.22
query6	1.24	1.09	1.07
query7	0.04	0.01	0.00
query8	0.06	0.03	0.04
query9	0.37	0.30	0.30
query10	0.56	0.55	0.54
query11	0.20	0.14	0.13
query12	0.17	0.14	0.14
query13	0.47	0.48	0.47
query14	1.01	1.00	1.00
query15	0.61	0.59	0.60
query16	0.32	0.33	0.33
query17	1.14	1.11	1.06
query18	0.23	0.21	0.23
query19	2.00	1.92	1.86
query20	0.02	0.01	0.02
query21	15.44	0.19	0.14
query22	4.94	0.05	0.05
query23	16.15	0.30	0.11
query24	3.03	0.40	0.31
query25	0.12	0.11	0.06
query26	0.78	0.20	0.15
query27	0.04	0.04	0.05
query28	3.50	0.90	0.54
query29	12.52	4.30	3.49
query30	0.29	0.14	0.17
query31	2.78	0.57	0.31
query32	3.22	0.59	0.49
query33	3.24	3.22	3.29
query34	15.56	4.23	3.52
query35	3.50	3.45	3.52
query36	0.55	0.41	0.39
query37	0.08	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.18	0.17	0.15
query41	0.09	0.03	0.02
query42	0.04	0.03	0.02
query43	0.05	0.04	0.03
Total cold run time: 96.87 s
Total hot run time: 25.03 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 90.91% (10/11) 🎉
Increment coverage report
Complete coverage report

@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

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.

Automated review result: request changes.

Critical checkpoint conclusions:

  • Goal/test proof: The PR targets TIMESTAMPTZ dynamic partition UTC boundaries, but the add path fix is incomplete because cleanup still uses local-zone cutoffs and now is sampled twice. The new tests do not reliably prove the fix because the hourly test fails across UTC midnight.
  • Scope/focus: Changed scope is limited to FE dynamic partition scheduler and FE unit tests; no additional user-provided focus was supplied.
  • Concurrency/lifecycle: No new shared mutable state or lock order change found; the relevant lifecycle risk is durable partition names/ranges generated at scheduler time.
  • Config/session/compatibility: dynamic_partition.time_zone now controls names while TIMESTAMPTZ ranges are UTC; this propagation is missing in dynamic cleanup. No wire/storage format compatibility change seen.
  • Parallel paths: Add-partition path was updated, dynamic drop path was not.
  • Tests/validation: Static review only. Could not run FE tests because this runner lacks thirdparty/installed/bin/protoc; git diff --check passed for the two live PR files.

Subagent conclusions: optimizer-rewrite produced OPT-002 and duplicate OPT-001; tests-session-config produced TSC-001/TSC-002. MRG-001, MRG-002, and MRG-003 are submitted as inline comments; OPT-001 was merged as duplicate of TSC-002. Convergence round 1 ended with both subagents reporting NO_NEW_VALUABLE_FINDINGS for the final ledger/comment set.

// nowTz: configured-timezone clock, used for naming and storage properties
ZonedDateTime nowTz = ZonedDateTime.now(dynamicPartitionProperty.getTimeZone().toZoneId());
// now: used for border computation. For TIMESTAMPTZ, borders are UTC-based.
ZonedDateTime now = isTimestampTz ? ZonedDateTime.now(ZoneOffset.UTC) : nowTz;

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 new UTC boundary handling also needs to be applied to the dynamic cleanup cutoff. getDropPartitionOpForDynamic() still builds its reserved range from ZonedDateTime.now(dynamicPartitionProperty.getTimeZone().toZoneId()) and then converts that local midnight with the configured timezone. With time_zone = Asia/Shanghai and start = -3, the add path creates UTC-day ranges, but the drop path reserves from 16:00:00+00:00, so the previous UTC-day partition still intersects the reserved range and is not dropped. Please derive the drop cutoff with the same TIMESTAMPTZ UTC clock/source-timezone logic as the add path.

@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

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.

Automated review found two additional issues in the current head after accounting for the existing inline threads.

Critical checkpoint conclusions:

  • Goal/test: the PR aims to make TIMESTAMPTZ dynamic partition boundaries UTC-aligned while keeping configured-timezone naming. Add/drop range generation is partially covered, but the current-partition identity used by auto-bucket still uses configured-timezone names while ranges use UTC.
  • Scope: the change is focused on FE dynamic partition scheduling and FE unit coverage.
  • Concurrency/lifecycle: scheduler op construction still happens under the existing table read-lock flow, followed by existing write-lock mutation paths; I did not find a new lock-order or lifecycle issue.
  • Config/compatibility: no new config or persisted format was added. The dynamic_partition.time_zone behavior is compatibility-sensitive, and the accepted scheduler comment is about a remaining semantic mismatch in that behavior.
  • Parallel paths: existing threads already cover independent add-path clock sampling and the earlier drop-cutoff mismatch. The new auto-bucket finding is a distinct downstream path using the same local-name/UTC-range split.
  • Tests: the new tests cover day/week/hour and drop cutoff cases, but one exact-name assertion pattern can still flake at scheduler/test wall-clock boundaries, and there is no coverage for the auto-bucket current-partition mismatch.
  • Validation: static review only. This checkout is missing .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc, so I did not run the FE build or FE unit tests.
  • User focus: no additional user-provided focus was supplied.

Subagent conclusions: OR-1 was accepted as M-1 and submitted inline; TSC-1 was accepted as M-2 and submitted inline. No subagent candidates were dismissed or merged as duplicates. Convergence round 1 ended with both optimizer-rewrite and tests-session-config returning NO_NEW_VALUABLE_FINDINGS for the same M-1/M-2 proposed comment set.

@github-actions github-actions Bot left a comment

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.

Anchor repair for M-2: resubmitting the test-flake inline comment with an explicit line/side anchor after API verification showed the original position-based comment landed on the wrong test line.

Comment thread fe/fe-core/src/test/java/org/apache/doris/catalog/DynamicPartitionTableTest.java Outdated

@morrySnow morrySnow left a comment

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.

Review Summary

This PR correctly fixes TIMESTAMPTZ dynamic partition boundaries to align to UTC midnight by separating boundary computation (UTC-based) from partition naming (configured timezone). The approach is sound and the test coverage is thorough.

Issue found: getClosedRange() still uses configured timezone for reserved history periods

The getDropPartitionOpForDynamic() method now uses borderTimeZone (UTC for TIMESTAMPTZ) for its main drop boundary computation (lines 579-582). However, the getClosedRange() method (called at line ~602 for reserved_history_periods handling, lines ~516-519 in the file) still passes dynamicPartitionProperty.getTimeZone() to convertToUtcTimestamp(). For TIMESTAMPTZ tables with non-UTC dynamic_partition.time_zone AND reserved_history_periods configured, the reserved history ranges are shifted by the timezone offset relative to UTC-midnight partition boundaries. This can cause partitions near period boundaries to be incorrectly dropped.

Recommendation: Propagate borderTimeZone to getClosedRange() (e.g., pass it as a parameter) so all boundary computations in getDropPartitionOpForDynamic() use the same effective timezone.

Comment thread fe/fe-core/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java Outdated
@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions Bot left a comment

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.

Automated review completed.

I found one blocking compatibility issue: existing TIMESTAMPTZ dynamic partitions created before this change can overlap the new UTC-aligned ranges and block creation of the fixed partitions.

Critical checkpoints:

  • Goal/correctness: fresh TIMESTAMPTZ dynamic partitions are moved toward UTC-aligned boundaries, but upgrade compatibility for existing shifted ranges is incomplete.
  • Scope: the production change is focused on dynamic partition TIMESTAMPTZ boundary calculation and auto-bucket current-partition exclusion.
  • Concurrency/lifecycle: no new thread or locking concern found in the reviewed scheduler paths.
  • Config/compatibility: existing non-UTC TIMESTAMPTZ dynamic_partition.time_zone tables are affected; the inline comment covers the missing migration/gating path.
  • Parallel paths: add/drop/reserved-history and auto-bucket paths were reviewed. Existing wall-clock test concerns are already covered by prior review threads and were not duplicated.
  • Tests: added tests cover fresh UTC-aligned TIMESTAMPTZ behavior, but not the pre-fix shifted-partition upgrade state. I did not run FE tests because .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc are absent in this checkout; I performed static review and git diff --check.
  • User focus: no additional user-provided review focus was supplied.

Subagent conclusions: optimizer-rewrite reported OPT-1 as a duplicate of MAIN-1. tests-session-config reported TEST-1 as a duplicate of MAIN-1 and TEST-2 as a duplicate of an existing wall-clock-after-scheduler test thread. Convergence round 1 ended with both subagents returning NO_NEW_VALUABLE_FINDINGS for the same ledger/comment set.

dynamicPartitionProperty.getTimeZone());
nextBorder = convertToUtcTimestamp(partitionColumn, nextBorder,
dynamicPartitionProperty.getTimeZone());
prevBorder = convertToUtcTimestamp(partitionColumn, prevBorder, borderTimeZone);

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 fixes newly computed TIMESTAMPTZ ranges to UTC, but existing dynamic-partition tables that already have the old configured-timezone ranges will now block the fixed ranges. For example, before this change time_zone = 'Asia/Shanghai' created p20260706 as [2026-07-05 16:00:00+00:00, 2026-07-06 16:00:00+00:00). After upgrade this code wants [2026-07-06 00:00:00+00:00, 2026-07-07 00:00:00+00:00), which overlaps the old partition but is not equal. The overlap check below then sets isPartitionExists, records a create-partition failure, and continues, so the UTC-aligned partition is not created while the shifted partition remains. Please add an upgrade/compatibility path for existing TIMESTAMPTZ dynamic partitions, or gate the UTC-boundary behavior so existing tables do not get stuck with overlapping old ranges.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Codex automated review failed and did not complete.

Error: Codex completed, but no new pull request review was submitted for the current head SHA.
Workflow run: https://github.com/apache/doris/actions/runs/28780425678

Please inspect the workflow logs and rerun the review after the underlying issue is resolved.

@github-actions github-actions Bot left a comment

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.

Automated review found two blocking TIMESTAMPTZ dynamic partition issues.

Critical checkpoint conclusions:

  • Goal/test proof: the PR moves new TIMESTAMPTZ dynamic partition boundaries and names to UTC and adds FE tests for several add/drop/reserved-history paths, but it does not prove upgrade behavior for tables that already have offset-aligned persisted ranges, and it does not cover non-UTC storage lifecycle properties.
  • Scope/focus: the change is mostly focused on FE dynamic partition scheduling and auto-bucket history selection, but the remaining issues affect production correctness during upgrade and storage lifecycle timing.
  • Concurrency/locking: I did not find a new locking issue; the reviewed scheduler logic still computes ops under the existing table read lock and applies add/drop operations through existing write-locked paths.
  • Config/session propagation: session/JVM timezone paths were reviewed. The new add/drop/retention paths normalize TIMESTAMPTZ boundaries to UTC, but hot partition cooldown and storage-policy base time still use the configured-zone clock.
  • Compatibility: existing TIMESTAMPTZ dynamic tables created by the old non-UTC logic can partially overlap new UTC candidates and block creation.
  • Parallel paths: add, dynamic drop, reserved history, auto-retention, auto-bucket current partition exclusion, and tests were inspected; no other distinct issue remained after duplicate suppression.
  • Tests/validation: static review only. This runner is missing thirdparty/installed and thirdparty/installed/bin/protoc, so FE build/tests were not run.

dynamicPartitionProperty.getTimeZone());
nextBorder = convertToUtcTimestamp(partitionColumn, nextBorder,
dynamicPartitionProperty.getTimeZone());
prevBorder = convertToUtcTimestamp(partitionColumn, prevBorder, borderTimeZone);

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.

Existing tables that have already been scheduled by the old code can get stuck on the shifted layout. The old TIMESTAMPTZ path with dynamic_partition.time_zone = 'Asia/Shanghai' persisted daily ranges such as [2026-07-05 16:00:00+00:00, 2026-07-06 16:00:00+00:00). After this PR, the same table tries to add [2026-07-06 00:00:00+00:00, 2026-07-07 00:00:00+00:00). This loop checks every existing range with RangeUtils.checkRangeIntersect; because the old range partially overlaps but is not equal, the catch records a create failure, sets isPartitionExists, and skips the new partition. The same happens while old future partitions overlap the new UTC candidates, and when the first non-overlapping UTC partition is finally added there can be a gap between the last old 16:00 upper bound and the next UTC midnight. Please add an explicit upgrade/compatibility path, or a migration test that starts from pre-fix offset-aligned TIMESTAMPTZ ranges and verifies scheduler behavior after the UTC change.

Comment thread fe/fe-core/src/main/java/org/apache/doris/clone/DynamicPartitionScheduler.java Outdated
@starocean999

Copy link
Copy Markdown
Contributor Author

/review

@starocean999

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot left a comment

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.

Review summary:

I found one remaining issue in the newly added TIMESTAMPTZ hot-partition cooldown test coverage. The broader TIMESTAMPTZ dynamic-partition UTC-boundary work, AutoBucket range/name handling, drop cutoff, and retained-history handling were reviewed against the current head; the remaining production lifecycle and upgrade concerns I saw are already covered by existing review threads, so I did not duplicate them.

Critical checkpoint conclusions:

  • Goal and proof: The PR targets TIMESTAMPTZ dynamic partition boundaries/names and related cleanup/lifecycle paths. The added tests cover several units and cleanup paths, but the new hot-partition cooldown test does not prove the finite expected cooldown boundary, so I left one inline comment.
  • Scope: The code changes are focused on FE dynamic partition scheduling, AutoBucket historical partition selection, and FE tests.
  • Concurrency and lifecycle: The reviewed scheduler path computes add/drop ops while holding the table read lock and applies mutations later under write locks, matching the surrounding pattern. I did not find a new concurrency hazard in the changed code.
  • Config/session/compatibility: No new config was added. Existing concerns about pre-fix TIMESTAMPTZ partitions overlapping new UTC ranges are already covered by existing threads r3528082626 and r3528120739.
  • Parallel paths: I checked dynamic add/drop, auto-partition retention cleanup, AutoBucket historical partition selection, and the PartitionExprUtil AutoBucket caller. I did not find a new non-duplicate parallel-path issue.
  • Test coverage/results: I could not run FE tests in this checkout because .worktree_initialized, thirdparty/installed, and thirdparty/installed/bin/protoc are missing. Review validation was static.
  • User focus: No additional user-provided review focus was present.

Subagent conclusions:

  • optimizer-rewrite: Reported OPT-DUP-1, which I merged as duplicate of the existing storage-lifecycle TIMESTAMPTZ thread. Convergence round 1 returned NO_NEW_VALUABLE_FINDINGS.
  • tests-session-config: Reported TEST-001, accepted as MAIN-001 and submitted inline, plus TEST-002, merged as duplicate of existing upgrade-compatibility threads. Convergence round 1 returned NO_NEW_VALUABLE_FINDINGS.


// Cooldown time must be at UTC midnight (aligned with
// partition boundaries), not offset by America/Chicago.
if (dp.getCooldownTimeMs() != DataProperty.MAX_COOLDOWN_TIME_MS) {

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 new coverage still passes if the generated cooldown is missing or unparseable, because the UTC checks are skipped whenever dp.getCooldownTimeMs() is DataProperty.MAX_COOLDOWN_TIME_MS. That is exactly the fallback PropertyAnalyzer.analyzeDataProperty() uses after a storage_cooldown_time parse failure, so the test would not catch a regression where the TIMESTAMPTZ lifecycle string is rejected. For this setup with hot_partition_num = 1, each SSD partition should have a finite cooldown equal to that partition's upper endpoint (offset + hotPartitionNum). Please assert cooldownTimeMs != MAX_COOLDOWN_TIME_MS for every hot partition and compare the instant to the partition upper bound, rather than only checking that any finite value happens to be at UTC midnight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants