Repository navigation
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
There was a problem hiding this comment.
Reviewed #69298 at 7de569daeb9521790075380d85a36e81968bf400 against the supplied authoritative aggregate diff. All 77 changed paths were covered by the main review and two reviewers with complementary scopes; an additional reviewer checked four cross-boundary risks.
The scheduling and scan hot-path changes broadly implement their stated goal. Four P2 issues are reported inline: retained manifests fail after source-schema cleanup, recovered schema names can collide with partition names, detached prefetch can outlive its FileIO owner, and one existing producer test retains malformed scan envelopes. No existing inline threads or independently confirmed existing P0/P1 comments were present. No additional user focus was supplied.
The invocation chain reviewed was:
statement -> captured query groups -> SPLIT producer -> Hive/Iceberg source
| |
| METADATA workers
v |
assignment + BE queues <-+
|
SplitSource / compaction
|
BE descriptor iterator -> per-file reader
finish/cancel -> stop groups/producers -> statement/read-lease cleanup
Applicable code-review skill checkpoints:
| Checkpoint | Conclusion |
|---|---|
| Goal and proof | Fair task groups, separate metadata workers, bounded completion-order prefetch and smaller transport envelopes are implemented. Checked-in tests cover their main behavior; the four reported cases need fixes. |
| Scope and abstraction | Broad but related changes span scheduling, lifetime and scan transport. Shared helpers and SPI keep generic planning connector-agnostic. |
| Concurrency and protected state | Worker, planner, cancellation and RPC threads use captured sessions, atomics/concurrent queues, group admission locks, producer scheduleLock and assignment/readiness/consumer locks. The detached-load ownership issue is reported inline. |
| Work under locks | External reads, future waits and user callbacks are outside registry locks; backend-policy mutation remains serialized separately from readiness publication. |
| Lock order and deadlock | Reviewed admission/listener/queue/cleanup paths showed no additional concrete lock cycle. |
| Lifecycle and initialization | Captured groups reject resurrection, queued work cancels, and source cleanup is cooperative. Running metadata callables still need ownership through actual exit. No C++ static-initialization change. |
| Configuration | Three FE worker/capacity settings are restart-scoped and captured at creation. The forwarded session manifest concurrency is validated to 1..64 and shared across query scans. |
| Symbol/protocol/storage compatibility | Connector API major advances 18 to 19 with surface/version baselines; no new persisted format. Existing BE readers support nested range descriptors. |
| Thrift/protobuf definitions | None changed. Existing optional per-range fields and query-option defaults were checked at consumption sites. |
| Parallel paths | Both Coordinator and ThriftPlansBuilder compact transport copies; streaming enforces the original split count before compaction. Native/JNI and row-id paths consume per-range formats. |
| Special conditions | Backpressure/cancellation conditions have concrete triggers and comments. URI-prefix reuse and backend candidate clamping preserve reviewed semantics. Dropped-source recovery has the two inline defects. |
| Test coverage | Positive/negative, cancellation, failure, queue-capacity, single-worker, race, serialization, path and schema-promotion cases exist. The stale producer fixture introduces an intermittent test failure. |
| Changed expected results | Hive fixture totals and Iceberg count/sum/union/limit outputs are consistent by inspection. Output-generation provenance was not independently reproduced. |
| Observability | Fair-executor pool/active/queue/group/completion metrics and existing generation/cache profiles and exception context cover the new paths. No separate proven gap found. |
| Transactions, persistence and failover | Read planning and write-format inference are changed; no EditLog, committed-data visibility, rowset version or MoW delete-bitmap protocol change. Read resource ownership was traced through statement cleanup. |
| Writes and atomicity | No new data-write or commit protocol. Write-side ORC inference remains; no additional atomicity defect identified. |
| FE-to-BE values | Formats, credentials, partitions and connector descriptors remain in existing fields and survive both transport paths. |
| Performance and memory | Producer work, task queues, prefetch results and query read permits are bounded. Warm-cache reads avoid futures; path reuse and envelope compaction avoid repeated wrapper work. Scanner concurrency is preserved by the wrapper floor. |
| Other issues and final recheck | Retry/Flight/planning-only cleanup, continuation admission, schema evolution/delete matching, mixed formats/JNI and test fixtures were rechecked. Every candidate and initial risk has an explicit ledger disposition. |
Validation was static only, as required: no builds, tests, cluster execution or source edits. Author-reported performance and test results were not independently rerun. There are no unresolved candidates or uncovered changed paths within this static scope. The review converged after 2 rounds: every assigned reviewer returned NO_NEW_VALUABLE_FINDINGS on the same frozen set.
Review converged after 2 round(s).
TPC-H: Total hot run time: 28431 ms |
TPC-DS: Total hot run time: 150261 ms |
ClickBench: Total hot run time: 24.35 s |
7de569d to
eadfc6f
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of all 77 changed paths at eadfc6f identified one additional P2: an outer cloud replan retry can permanently retain newly allocated scheduler groups after repopulating a closed statement scope. The inline comment describes the trigger, ownership chain and fix direction.
The four existing P2 reports remain applicable and are not duplicated: retained-manifest schema cleanup (4317059423), recovery-schema name collisions (4317059437), metadata callable/table-owner lifetime (4317059444), and malformed producer-test envelopes (4317059450). There are no existing P0/P1 findings to carry as blocking IDs. No additional user-provided focus was supplied.
- Goal and proof: the code implements query-owned fair scheduling, separate metadata workers, cooperative split production, bounded completion-ordered prefetch and smaller transport envelopes. Tests cover these mechanisms; the new retry leak and known P2 cases qualify the correctness conclusion.
- Scope and clarity: the changes are broad but follow the documented scheduling/hot-path goal and connector SPI boundary. Per-file format replaces read-side format inference; writer inference remains available.
- Concurrency: traced planning, SPLIT/METADATA workers, BE-fetch RPCs and cancellation/finalization. CAS/queues own task publication; admission, producer, readiness, backend-policy and per-backend wait locks protect their respective state. Tasks, IO and callbacks execute outside scheduler registry locks. No additional deadlock, lost wakeup or concurrent source iteration was verified.
- Lifecycle: captured groups reject resurrection through an old session; normal cleanup, planning failure, inner retries and deferred Flight were traced. Outer replan scope reuse is the new inline finding; running FileIO owner retention is the existing report. No static initialization issue applies.
- Configuration: three FE thread/queue settings are nonmutable and captured at executor creation; no dynamic-resize promise is made. Session manifest concurrency is forwarded, checked in [1,64] and shared through a query-scoped semaphore.
- Compatibility: connector API advances 18.0 to 19.0 with its version assertion and plugin surface baseline. New SPI defaults/forwarding are present. ConnectorMetadata methods, persisted formats and existing wire descriptors are unchanged.
- Thrift/protobuf definitions: none changed; cross-branch field-ID comparison is inapplicable.
- Parallel paths: checked Hive/Iceberg, cache-on/off, synchronous/streaming/COUNT, metadata tables, both FE dispatch builders and BE local/remote split readers. Per-file formats precede reader/schema setup, including ORC and row-ID fetch.
- Special conditions: startup demand bypasses the single-lane case; terminal changes wake consumers; admission rechecks cover early dequeues. Partition adaptation uses field IDs, preserves nulls and rejects lossy narrowing. Known schema-recovery cases remain reported above.
- Test coverage: reviewed changed unit and regression cases for queue pressure, fairness, cancellation, failure, schema promotions, deletes, mixed formats, serialization and LIMIT/full/multiple scans. Outer replan group cleanup needs coverage; the existing malformed fixture and three Iceberg edge cases also remain gaps.
- Expected results: Hive expectations match the added scheduling configuration. Iceberg IDs 0..191 imply 192 rows/distinct IDs and sum 18336; UNION gives 384 and 36672, and LIMIT counts are 10. Actual execution and output-generation provenance were not independently established.
- Observability: pool size, active/queued tasks, group count and completions have metrics; existing scan profiles, atomic manifest counters and contextual errors remain. No additional necessary observability omission was verified.
- Transactions/persistence: no EditLog, committed-data visibility or persisted-version protocol changes. Read-transaction cleanup remains classloader-pinned; the lifetime issues are identified separately.
- Writes/atomicity: no new data mutation or commit protocol; write-format inference preserves its previous resolution/failure behavior. No additional crash/atomicity regression was verified.
- FE/BE propagation: no new wire variable. Compaction preserves all inner descriptors, parameter/volume/location boundaries and separate split sources; both BE readers drain every inner range and remote EOF requires an empty response.
- Performance/resources: bounded task queues, one pending producer batch, manifest windows/read budgets, capped hash candidates and per-producer path reuse address the intended costs. Scanner parallelism is retained. The new permanent group retention is the resource exception; reported benchmarks were not rerun.
- Further review: independently challenged continuation overlap, callback reentry, option defaults, historical cache load orders, delete matching, ORC initialization and both retry loops. Only the outer-replan scheduler leak adds a distinct finding beyond the existing threads.
Review converged after 2 rounds: all three latest reviewers returned NO_NEW_VALUABLE_FINDINGS on the unchanged one-comment set. All changed paths, candidates and risk focuses have explicit dispositions; no unresolved review question or uncovered changed path remains. Validation was static only: no builds, tests, runtime stress or benchmark reruns, and no repository source changes.
Review converged after 2 round(s).
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 28445 ms |
TPC-DS: Total hot run time: 150530 ms |
ClickBench: Total hot run time: 24.26 s |
eadfc6f to
8b6086f
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Reviewed all 78 changed paths at 8b6086f, including production code, deleted code, tests, documentation and expected results. No additional distinct inline findings were substantiated. This is a static review, not an approval of the unresolved issues already discussed.
Five existing P2 findings still apply and are not reposted: outer replan scope/task-group leak, producer test envelopes incompatible with compaction, prefetch callable outliving its table/FileIO owner, recovery-schema partition-name collision, and retained manifests after historical-schema cleanup. No existing P0/P1 finding was present or independently confirmed, so existing_blocking_comment_ids is empty.
Critical checkpoint conclusions:
- Goal and evidence: separate SPLIT/METADATA workers, cooperative producer continuations, bounded manifest prefetch and transport compaction implement the intended scheduling design. Added unit and regression tests exercise the intended behavior; the five known defects above remain.
- Scope and reuse: scheduling, per-producer path reuse, backend candidate bounds and transport helpers form a coherent scan-planning change. The removed read-format cache is replaced by existing per-file format metadata; write-side format resolution remains intact.
- Concurrency and locking: traced request, producer, metadata, RPC and cancellation threads through queue admission, listener registration, readiness and terminal notifications. Remote loads and future waits occur outside the manifest pending lock; callback and queue lock ordering did not establish another defect. Scheduling is cooperative and cannot preempt an SDK call that does not return.
- Lifecycle: checked queued/running futures, backpressure suspension, early LIMIT, planning failure, EXPLAIN, retry and deferred Arrow Flight cleanup. Existing owner-lifetime and outer-retry findings cover the verified remaining failures; no additional lifetime issue was substantiated.
- Configuration: worker counts are startup settings; the bounded manifest concurrency and initial batch size are validated session settings and forwarded where required. Initial delivery limits real splits before compaction and does not suspend producer lookahead.
- Compatibility: connector API major version advances to 19.0 with the changed public surface baseline; ConnectorMetadata's baseline surface is unchanged. Both FE plan builders preserve existing FE/BE descriptor fields, and BE already flattens multiple ranges per envelope. No Thrift/protobuf definitions or persisted format changes occur.
- Parallel paths: reviewed synchronous/streaming/COUNT planning, Hive partition lanes, native/JNI metadata reads, V1/V2 scanners, mixed ORC/Parquet files, row-id fetches and write-format callers. Per-range physical formats and Iceberg field-id mappings remain authoritative.
- Conditions and errors: examined admission/full/closed states, cancellation during permit waits, empty or filtered scans, unsupported formats and lossy historical conversions. Failures propagate through their established error channels; known schema-recovery defects are covered by the existing threads.
- Test coverage and expected results: inspected admission, fairness, cancellation, wakeup, bounded-window, promotion/delete, transport serialization and path-identity tests, plus Hive and Iceberg regression cases. Expected aggregate results are internally consistent. The remaining malformed fixture is the existing test finding linked above.
- Observability: new pool/active/queued/completed/group metrics complement existing scan profiles and cache counters; no additional observability defect was established.
- Persistence and failover: no EditLog, internal partition-version, rowset or delete-bitmap changes. Snapshot pinning and delete-file metadata were traced through cache adaptation before residual/delete matching; the two known historical-spec recovery issues remain.
- Writes, transactionality and crashes: write-format property/inference behavior remains, and no write commit or atomicity protocol changes were introduced. Cancellation/resource failure analysis is covered by the lifecycle conclusions above.
- FE/BE variable passing: transport compaction retains per-file descriptors and existing fields in both plan builders; new session controls are consumed in FE rather than requiring new BE wire fields.
- Performance and memory: inspected bounded task queues/read windows, short-held locks, per-producer path reuse and physical-backend candidate clamping. Synchronous compaction retains the scanner concurrency upper bound. No additional static performance regression was substantiated; performance claims were not independently benchmarked.
- Further issues and user focus: no additional focus was supplied. The final missed-path sweep found no unresolved static candidate or uncovered changed path.
Converged in 1 review round: all three assigned reviewers, including the separate risk reviewer, returned NO_NEW_VALUABLE_FINDINGS on the unchanged empty new-comment set. Builds, tests and runtime/remote-I/O timing validation were not performed under this review-only contract. Delivery verification is separate from convergence.
Review converged after 1 round(s).
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 28212 ms |
TPC-DS: Total hot run time: 150104 ms |
ClickBench: Total hot run time: 24.42 s |
FE Regression Coverage ReportIncrement line coverage |
8b6086f to
ff44a87
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Reviewed exact head 62a461e31a827144ac72ad413f28edff70c7e088. No new reportable defect was found after complete static review of all 86 changed paths and related callers/consumers. The earlier inline issues were revalidated as fixed, including P1 partition/delete matching, pre-registration planning cleanup, and COUNT cancellation test arguments. No existing P0/P1 finding was confirmed to remain applicable.
Code-review checkpoint conclusions:
- Purpose and correctness: bounded cooperative scan scheduling, independent metadata workers and first-response sizing follow the actual statement-to-BE flow; inspected tests cover split conservation, fairness and failure/cancellation behavior.
- Scope and abstraction: engine scheduling stays connector-agnostic through the SPI; related path/assignment optimizations and format-cache removal support the same scan-planning change.
- Concurrency and locks: traced planning, producer, metadata, completion, cancellation and RPC threads. Policy, readiness, admission and backend wait-channel state have separate protection; callbacks and remote I/O execute outside registry locks. No concrete deadlock or lost-wakeup defect was found.
- Lifetimes: checked EXPLAIN/planning failure, prepared execution, both retry loops and deferred Arrow Flight. Groups terminate without resurrection; active shared readers retain the exact table/FileIO owner until callable exit, while cancelled followers detach. No static-initialization issue applies.
- Configuration: FE worker/queue settings are immutable startup settings. Session initial-batch and manifest-concurrency settings are validated, forwarded and captured for query use; the read budget is shared across the statement's scans.
- Compatibility: the connector API major and recorded public surface move together to 21.0. Existing wire descriptors retain per-file metadata and formats; no persistent storage format or function-symbol change was identified.
- Thrift/protobuf IDs: no definitions changed; cross-branch field-ID checks are not applicable.
- Parallel paths: inspected partition and whole-scan streaming, synchronous planning, both COUNT paths, cache-disabled SDK fallback, pinned/time-travel schemas, system tables, rewrite filtering, both FE transport builders and BE V1/V2 native/JNI consumers.
- Conditions: cancellation guards, serial-first reads, demand-controlled prefetch, batch-mode gating and compaction boundaries have concrete triggering scenarios. Empty and fully filtered scans still progress; invalid formats/conversions fail visibly.
- Test coverage: inspected unit/race/negative tests and Hive/Iceberg regressions, including source-schema expiration, mixed cache warmth, exact-owner retention, queue capacity and EOF. No new static test defect was found.
- Changed expected results: aggregate and ordered outputs agree with the fixture arithmetic. Static inspection cannot prove how output files were generated.
- Observability: separate executor metrics, split profiles, concurrent cache counters and error channels expose the changed paths; no missing critical signal was established.
- Transactions/persistence/failover: no EditLog, visible-version or transaction-commit protocol changes; connector read-transaction cleanup remains query-owned.
- Writes/atomicity/crashes: no new data mutation path; writer-side format inference retains its behavior. Cancellation/error exits preserve resource cleanup in the inspected flow.
- FE/BE values: both synchronous senders and batch RPC delivery preserve all inner descriptors. BE iterates every compacted range, retains scanner concurrency and treats only an empty response as EOF; physical range formats override Iceberg's scan-level default.
- Performance/resources: pending work and prefetch windows are bounded; warm reads avoid executor traffic and shared-load followers release metadata workers. Parser reuse, candidate capping and variance checks remove repeated work. Fairness remains cooperative across blocking SDK calls.
- Additional concerns: the supplied focus file contains no additional user focus. Final missed-case checks found no further verified issue or unresolved static coverage gap.
Validation limits: this invocation performed static inspection only, as required. No builds, tests, live SQL or performance measurements were run, and historical PR benchmark/test claims were not independently reproduced.
Review converged after 2 round(s).
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 28640 ms |
TPC-DS: Total hot run time: 151399 ms |
ClickBench: Total hot run time: 24.3 s |
FE Regression Coverage ReportIncrement line coverage |
62a461e to
b756054
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of PR #69298 at b756054 identified one new verified P2 issue: dropped partition-source recovery orders schema IDs numerically and can mislabel a retained LONG manifest as INTEGER, causing a cold streaming scan to fail. All 86 changed paths and their relevant upstream/downstream mechanisms were covered. The review converged in 3 rounds, including an unchanged-payload final pass on the complete one-finding set by the complete reviewer and both focused risk reviewers.
All eleven supplied existing threads were revalidated without reposting them. In particular, P1 comment 4322080662 is fixed: scan-local UNKNOWN partition projections normalize Integer/Long and Float/Double representations before both data/delete matching, with mixed warm/cold schema-cleanup coverage. No existing P0/P1 finding remains applicable. The prior COUNT reflection arguments, pre-scan and replan group cleanup, scheduler-cancellation fallback, delete-manifest budget, running-reader ownership, test envelopes and retained-schema/name-collision concerns are also addressed at this head.
| Required checkpoint | Conclusion |
|---|---|
| Goal and supporting tests | Query-owned SPLIT/METADATA scheduling, cooperative producers and bounded manifest prefetch follow the stated goal. Dedicated unit and Hive/Iceberg regression cases cover the principal paths; inspected only. Recovery on nonmonotonic schema IDs remains defective as described inline. |
| Scope and clarity | The large change remains coherent around external scan scheduling, bookkeeping and delivery. Admission, read lifetime and partition adaptation have separate helpers. |
| Concurrency, lock scope and order | Traced planner, SPLIT/METADATA workers, fetch RPCs, cancellation and shared-load callbacks. Listener registration/rechecks prevent missed capacity notifications; producer scheduling coalesces wakeups. Remote I/O and callbacks stay outside short scheduler registry locks. No substantiated deadlock or duplicate producer execution found. |
| Lifecycle and initialization | Captured groups remain terminal after close. Readers retain the exact table owner until the callable exits. Planning failures, EXPLAIN, prepared executions and retries receive cleanup; deferred Flight retains its callbacks until finalization. No C++ static initialization change. |
| Configuration and dynamic behavior | FE worker/capacity settings are startup settings with lazy executor creation. Session concurrency and initial fetch size are validated and forwarded. Initial delivery limits preserve background lookahead. |
| API and format compatibility | Connector plugin API advances from 21.0 to 22.0 with the updated surface baseline/version test; ConnectorMetadata's method surface is unchanged. Existing wire descriptors carry each file's physical format and metadata. No storage-format change. |
| Thrift/protobuf IDs | No gensrc definitions change, so cross-branch field/enum-ID comparison is inapplicable. |
| Parallel paths | Checked synchronous/streaming, materialized/representative/COUNT fallback, data/delete manifests and equality-field discovery, Hive listing, both coordinator builders, and native/JNI consumers. |
| Conditional checks and errors | Cancellation propagates instead of starting SDK fallback; ordinary cache failures retain the existing active-query fallback. Warm probes avoid executor/permit work. Historical narrowing guards fail explicitly; source recovery incorrectly treats schema identifiers as chronological, as described inline. |
| Test coverage | Inspected queue saturation, wakeups, cancellation, completion races, owner/permit release, schema evolution, mixed cache warmth, request boundaries and full/LIMIT/multiple-scan cases. A retained post-promotion manifest with nonmonotonic schema IDs needs coverage. No tests were executed. |
| Changed expected results | Added Hive results agree with the reused fixture; Iceberg count/distinct 192, sum 18336, UNION 384/36672 and LIMIT 10 agree with the generated IDs. Output-generation provenance was not independently established. |
| Observability | Fair-pool size, active/queued tasks, query groups and completion metrics use the existing thread-pool metric framework. Existing cache/scan profiling and failure causes are retained. |
| Transactions, persistence and failover | Read-transaction release stays in query finalization, now including planning-only attempts. No EditLog, durable metadata or visible-version protocol changes. Scheduler groups are transient. |
| Writes, atomicity and crash behavior | Read scheduling introduces no write-commit protocol. Write-format inference remains property-first with its existing fallback. Shared-cache publication keeps its generation fence; cancellation retains running-reader ownership. |
| FE-BE propagation | New values control FE planning and use session forwarding. BE already consumes every descriptor and selects range-local formats; compacted response size is not EOF. No new BE wire variable. |
| Performance and remaining issues | Queues and completed manifest windows remain bounded; shared-load followers release workers. Path reuse and bounded candidate lookup avoid repeated work. Compaction preserves descriptors, stream boundaries and the conservative BE scanner-concurrency floor. The one verified recovery regression is reported inline; no further verified issue was found. |
Core invariants: scan-local partition adaptation precedes residual/delete evaluation and leaves shared cache payloads unchanged, but its source-type assumption fails for the retained-manifest scenario reported inline. No native partition-version or MoW bitmap change is involved. Ownership and bounded FE allocations were traced; no BE allocation path changes. Failures remain explicit rather than silently dropping scan work.
User focus: no additional focus points were supplied. All five initial risk areas have evidence-based dispositions: R4 yields the accepted inline finding; R1-R3 and R5 were dismissed with evidence. No unresolved candidate or uncovered changed path remains. Validation remains static-only: builds, tests, runtime concurrency stress and output-generation provenance were not verified in this invocation.
Review converged after 3 round(s).
| Types.NestedField source = spec.schema().findField(field.sourceId()); | ||
| if (source == null) { | ||
| source = table.schemas().entrySet().stream() | ||
| .sorted(Map.Entry.<Integer, Schema>comparingByKey().reversed()) |
There was a problem hiding this comment.
[P2] Recover dropped sources without ordering schema IDs
For a v2 table with retained schema history S100(p INT) then S20(p LONG), keep a live manifest written under S20, then remove identity(p) and drop p while retaining both schemas. Schema IDs need only be unique (specification); the SDK parser preserves the supplied IDs. This sort selects S100 and labels the manifest's physical Long(7) partition as INTEGER. The SDK reads physical LONG as Long and stores it in the expected partition struct, so forScan to the current UNKNOWN spec reaches IcebergPartitionValueAdapter's Integer cast and throws ClassCastException. With manifest caching enabled, a cold streaming scan fails during lazy iteration, outside streamingFileScanTasks' fallback. Recover a compatible source type from metadata history or the manifest header instead of the greatest numeric ID. This differs from the prior UNKNOWN finding: one entirely cold data manifest fails without deletes, mixed cache warmth or schema expiration.
There was a problem hiding this comment.
Fixed in 3c8c571. The cache now resolves partition source types from the snapshot that added the manifest and its schema, without ordering schema IDs. If that snapshot or schema has expired, it lets Iceberg read the physical type from the manifest header. The new cold-manifest regression reproduced ClassCastException on the previous code for both retained and expired writer snapshots; both pass after the fix, along with all 31 IcebergManifestCacheTest cases.
TPC-H: Total hot run time: 28704 ms |
TPC-DS: Total hot run time: 151290 ms |
|
run buildall |
|
/review |
ClickBench: Total hot run time: 24.43 s |
There was a problem hiding this comment.
Reviewed #69298 at 3c8c571. No new substantiated findings. Converged in 1 review round after complete static coverage, independent engine/connector reviews and a separate risk investigation.
Existing threads were revalidated and deduplicated. The prior P1 UNKNOWN-partition delete-matching issue (4322080662) is fixed by common data/delete normalization; no existing P0/P1 finding remains confirmed on this head. The earlier schema recovery, source-name collision, running-reader lease, delete-read budget, scheduler cancellation, attempt cleanup/retry and test-signature/envelope concerns are also addressed. No additional user focus was supplied.
Critical checkpoint conclusions:
- Goal/proof: cooperative split scheduling, separate metadata workers, query cancellation, bounded manifest prefetch and compact transport are implemented along the traced call chains. Added tests exercise the intended behavior; they were inspected only.
- Scope/clarity: the cross-layer changes serve these scheduling and scan-planning goals; common admission, cache and adaptation helpers are reused.
- Concurrency/locks: traced request, cancellation, split, metadata, completion and RPC threads. Queue registration rechecks, atomic task ownership and producer coalescing cover the investigated races; remote work and callbacks stay outside scheduler registry locks. No concrete new deadlock, lost wakeup or duplicate production was established.
- Lifecycle: captured groups close on cancellation and nondeferred attempt completion, including pre-scan failures. Both retry paths replace scopes; prepared execution gets fresh state; deferred Flight retains its original cleanup. Actual shared readers retain their table owner until callable exit.
- Configuration: FE worker/capacity knobs are startup settings; session initial-batch and manifest-concurrency values are validated and forwarded. No dynamic-update promise is introduced.
- Compatibility: plugin API major/surface is consistently updated to 22.0; existing nested file-range transport is preserved. No persisted format change.
- Thrift/protobuf IDs: no definitions changed; cross-release field-ID comparisons are inapplicable.
- Parallel paths: examined partition/whole-scan sources, cache-on/off, materialized/streaming/both COUNT fallbacks, historical/metadata/mixed-format reads, both FE dispatch builders and both BE scanner versions. Cancellation does not restart SDK planning.
- Special conditions: first-read/demand gating, filtered scans, UNKNOWN recovery, lossless historical projections, empty partitions and initial-fetch limits have concrete conditions and coverage. No further defect found.
- Tests: inspected all changed unit/regression cases, including latch-driven admission/cancellation, owner retention, schema evolution, delete matching, exact delivery and descriptor roundtrips. No new statically demonstrable test failure found.
- Test outputs: Hive and Iceberg counts/sums agree with fixture SQL. Actual output-generation provenance is unverified.
- Observability: scheduler pool/active/queued/group/completed metrics and concurrent cache tallies expose the changed paths; errors preserve causes and manifest context.
- Persistence/transactions: no EditLog, replay, visibility-version or commit/failover protocol changes; statement/read-resource cleanup remains ordered and idempotent.
- Writes/atomicity: write-format inference preserves property precedence and fallback behavior. Transport compaction leaves assignment objects intact; no new publication or atomicity protocol.
- FE/BE variables: no new wire field; existing session forwarding and explicit per-range physical formats remain. Both dispatch paths supply existing query options.
- Performance/memory: task work, per-query queues, prefetch windows and per-producer path retention are bounded. Warm cache avoids scheduling; format discovery no longer enumerates data manifests. Compaction preserves the scanner-count bound and every nested range. No benchmark claim is made.
- Further recheck: revisited callback-before-return, continuation/cancel schedules, prepared/retry/Flight ownership, retained/expired writer schemas, both cache-warmth orders, special numeric partition keys and actual ORC/Parquet dispatch. No unresolved candidate remains.
Limits: static review only, as required. No builds, tests, cluster/external-service execution, race stress or benchmarks were run. Runtime test outcomes and generated-output provenance are unverified; there are no outstanding assigned static coverage gaps.
Review converged after 1 round(s).
…refetch Issue Number: None Problem Summary: External scans can monopolize shared FIFO workers, wait for work submitted to their own pool, repeat scan metadata work, and load cold Iceberg manifests serially. Introduce query-owned bounded task groups, separate split and metadata workers, cooperative continuations, bounded completion-order manifest prefetch, and query-owned cancellation/error cleanup. Keep scan path reuse, bounded backend candidate lookup, scan envelope compaction and format handling with scheduling. Notify backend consumers on data, completion, failure and cancellation to avoid terminal polling delays. Limit the first split response independently of producer batches and bounded queues. Producers continue prefetching before BE consumption, preserving overlap with BE startup. On the same Release BE and 1,000-partition Hive table, 100 four-query LIMIT groups improve from 15.38 ms to 11.82 ms median versus the pre-delivery-change FE. With a controlled 20 ms per-directory wait and 300 ms initial consumer delay, full scans remain 388.52 ms versus 386.96 ms; all COUNT/SUM results match. Review repairs: share Manifest completion without blocking metadata workers, retain the exact table/FileIO owner until each running load exits, preserve readable fixed-result specs after historical schema cleanup, prevent recovery-name collisions, reset task ownership on outer replans, and use complete producer test envelopes. Preserve the upstream source-nullability API and advance the combined connector contract to 20.0. Final rebased validation: 1,836 broad tests passed before the final UNKNOWN projection correction; all 1,503 Iceberg tests were rerun after that correction (one intentional live-test skip), and 25 focused data/delete projection tests passed. build.sh --fe -j4 and Checkstyle passed. The prior performance/live-SQL validation below predates these review repairs. Review follow-up: share the statement read budget across data manifests, eager position/equality delete-index loads and cold equality-field discovery. Reuse one read-admission/lifetime helper, retain cached-only fast paths, and propagate cancellation without restarting SDK planning. Tests exercise data/delete overlap with concurrency one, position/equality discovery, cancellation while waiting, and owner/permit release after failure. Final validation: 1508 Iceberg tests ran with zero failures/errors and one intentional live-test skip; build.sh --fe and Checkstyle passed. Review follow-up: propagate terminal cancellation before first metadata scheduler acquisition and verify the captured query lifetime before all four SDK fallback paths. Added engine lifecycle and streaming/materialized/COUNT cancellation tests. Recover readable physical partition specs from Manifest headers only when expiration removed every source schema; normal and promoted schemas keep one-stream reads. Real identity/truncate data/delete cleanup tests preserve values and delete matching. Validation: 1521 Iceberg package tests (one skip), two lifecycle tests, full FE build and Checkstyle passed. Parameter correctness follow-up: check the query-level batch-mode switch at the generic scan entry before partition capability or file-streaming estimation. Disabled mode no longer bypasses the switch through partition batching. Keep existing thresholds and producer/queue defaults after local candidate-default testing found small-table regressions. Final switch-only validation: 61 FE unit tests passed with zero failures/errors/skips; Checkstyle reports zero violations. Live Hive and Iceberg EXPLAIN confirms enabled/disabled path selection. Review follow-up: reproduce the equality-delete key mismatch after numeric promotion, mixed Manifest cache warmth, source-column removal and source-schema expiration. Normalize scan-local UNKNOWN numeric partition representations without mutating cached files, preserving exact values and known historical types. Cover both cache orders and identity/truncate specs with concurrent projections and different-partition exclusion; verify SDK wrapper equality/hash for numeric edge cases. Update the stale pre-capture cancellation assertion to CancellationException. Validation: 1,526 Iceberg tests and 56 FE lifecycle tests completed with zero failures/errors and one existing live-connectivity skip; full build.sh --fe and Checkstyle passed. Performance follow-up: index query-owned split channels and capacity waiters by stable backend ID instead of repeatedly hashing Backend endpoint/health metadata. CPU flamegraphs for 160 full-scan SQL locate 390 samples in batch1 queue lookup, versus 4 with batch128; the backend-ID change reduces that path to 37 samples without changing producer batch size, buffer capacity, notifications or fair scheduling. A controlled queue-index-only ABBA test reduces the single-query batch1 overhead relative to each phase's batch128 control from 6.3-7.5% to 2.5-3.8%; it does not establish elimination of every granularity cost. Preserve completion before any backend is assigned by skipping nonexistent queue-listener cleanup. Validation: 63 split/queue/producer/three-backend streaming unit tests pass; full FE build including Checkstyle passes; 1600 formal complete SQL and separate cache-hit profiles pass, with additional Hive COUNT/SUM/LIMIT and Iceberg cold LIMIT checks. Ready split batches are drained together within each BE request, capped at 64 producer batches and the number that fits the remaining request. This amortizes queue operations and per-batch channel checks without waiting to fill a response or changing producer buffering. Capacity callbacks execute after the queue lock is released; callback-published errors and cancellation are checked before returning the drained data. The scalar path still handles empty queues and partial batches. A four-phase fixed-Release-BE comparison on a warm 10,000-file Iceberg table narrows single-query batch-one overhead against each phase's batch128 control from 5.8–6.4% to 0.7–2.8%. Four-query full scans show no stable change. The initial four-query LIMIT difference of approximately 1 ms does not reproduce in a separate 3,200-SQL reverse-order repetition; sub-millisecond differences remain noisy. CPU samples inside getNextBatch are essentially unchanged (392 versus 389), while allocation samples fall from 444 to 174, mostly boxing and iterators. These are statistical samples, not exact invocation/byte counts. Across both formal comparisons, 4,800 SQL statements pass result checks; separate cache-hit profiles, Hive correctness and Iceberg cold LIMIT startup checks also pass. Both isolated PR and integration worktrees pass 66 focused unit tests and full build.sh --fe including Checkstyle. This comparison changes only SplitSource.class; plugins and the Release BE are identical. External scan task groups support bounded fair scheduling, cancellation and concurrent Iceberg manifest loading. The split_initial_batch_size session variable (default 64) controls the first response per backend independently of producer batches and buffered prefetch. File formats and pinned snapshot semantics are preserved. - Test: Clean build.sh --fe including Checkstyle; 750 scoped FE/SPI/Hive/Iceberg unit tests; Hive streaming and Iceberg scheduled-split regression suites; three-version matched Release-BE comparisons with 1,200 LIMIT SQL and 150 full scans, all result-checked; diagnostic 400-query first-response bound and terminal-wakeup verification. - Behavior changed: Yes, external scan scheduling, bounded metadata prefetch and initial split delivery. - Does this need documentation: Yes, developer scheduling documentation included. Small-batch follow-up: skip redistribution heap construction when the existing weight index already satisfies the threshold. Read capacity-listener membership concurrently to bypass the query-wide monitor for successful offers and unblocked consumers; retain registration-before-retry under the monitor to prevent lost wakeups. Additional validation: 120 focused FE tests and full FE build/Checkstyle pass. A 3200-SQL fixed-Release-BE three-backend alternating experiment preserves LIMIT latency; complete full-scan medians remain approximately flat. Separate equal-workload profiling reduces FE active CPU samples from 6385 to 4373 and allocation samples from 39174 to 25396.
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: A prepared execution can capture a METADATA task group before scan registration. If planning then fails, no query-finish callback exists and the group remains in the fair executor. Close any captured connector statement scope at the common attempt-finish boundary, including this early failure path. Also pass the pinned scan schema to two COUNT cancellation test helpers; their stale reflection argument lists made four FE UT cases fail before exercising cancellation. ### Release note None ### Check List (For Author) - Test: Unit Test: StmtExecutorTest and IcebergManifestReadContextTest (69 passed); FE build and Checkstyle passed. - Behavior changed: Yes (task groups are released after failed planning without a scan callback) - Does this need documentation: No
Issue Number: None Related PR: None Problem Summary: The scan scheduler adds public connector SPI methods. Master now uses connector plugin API 21.0 for typed filesystem credential descriptions. Keeping this PR at 21.0 would let plugins with different API surfaces claim the same major version. Advance this PR to 22.0 and keep the recorded surface test in sync. None - Test: Unit Test: ConnectorPluginSurfaceTest (2) and Checkstyle via a focused FE Maven run after rebase. The standard run-fe-ut.sh path was attempted but blocked by the host's unaccepted Xcode license and an x86-only gRPC generator without Rosetta; no scheduler source logic changed in this rebase. - Behavior changed: Yes, connector plugins now require API major 22. - Does this need documentation: No
### What problem does this PR solve? Issue Number: None Problem Summary: When a partition source is dropped, the manifest cache chose the largest retained schema ID as its physical type. Schema IDs are not chronological, so a cold manifest written with a LONG partition value can be decoded as INTEGER and fail with ClassCastException during lazy scan planning. Resolve the manifest writer snapshot and its schema when retained; otherwise let Iceberg read the physical type from the manifest header. A regression test reproduces the old failure for both retained and expired writer snapshots. ### Release note None ### Check List (For Author) - Test: Unit Test: IcebergManifestCacheTest, 31 passed via the JUnit launcher using the prior Surefire classpath; Maven test entry point is blocked by unresolved local reactor artifacts. - Behavior changed: Yes (correct physical partition type after schema evolution) - Does this need documentation: No
3c8c571 to
aa3fa71
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of #69298 at aa3fa71, against the supplied merge-base diff. All 86 changed paths were covered by the main review, two complete-review scopes and a separate integration-risk review. No new verified finding remains.
Existing review context: P1 comment 4322080662 is repaired. Both data and delete partitions pass through the scan-local adapter before matching, and UNKNOWN numeric targets now use consistent representations; the mixed-cache/schema-cleanup tests cover the reported scenario. It is neither reposted nor carried as a current blocker. The existing writer-schema, source-name/schema-expiration, read-budget, cancellation, callable-owner and execution-cleanup threads were also checked against their repairs.
Critical checkpoint conclusions:
- Goal and proof: the code implements query-owned bounded split/metadata scheduling, cooperative production, concurrent cold-manifest loading, cancellation and independent initial delivery. Focused unit/concurrency and Hive/Iceberg regression sources exercise these behaviors; this review does not establish runtime success.
- Scope and clarity: scheduler, cache, query-lifetime, path/backend bookkeeping and transport changes form one external-scan flow. No unrelated change was identified.
- Concurrency and locks: traced planner/request threads, SPLIT/METADATA workers, shared-load completions, cancellation and backend fetch requests. Backend policy, readiness, capacity listeners and consumer channels have separate protection; remote reads and user callbacks run outside registry locks. Queue reservation/publication, reentrant admission callbacks, continuation boundaries and terminal wakeups yielded no verified race or lock cycle.
- Lifecycle: captured groups cannot be resurrected through a cleared scope. EXPLAIN/planning failures, both retry paths, cancellation before coordinator publication and deferred Flight cleanup were traced. Running manifest callables retain their exact table/FileIO owner independently of Future cancellation. No C++ static initialization change is involved.
- Configuration: the three FE scheduler settings are restart-only; the initial-fetch and manifest-concurrency session values are validated and forwarded/captured. The read budget is shared across a statement's scans/catalogs; no promised dynamic update is lost.
- Compatibility: the connector plugin API version and public-surface baseline advance to 23.0. Existing transport structures and per-range formats are preserved; offline default schedulers remain available. No storage-format change was found.
- Thrift/protobuf IDs: no gensrc definition is changed, so no field/enum compatibility change requires cross-branch comparison.
- Parallel paths: checked synchronous, partition-batch and file-streaming planning, warm/cold data/delete reads, both COUNT variants, SDK fallback, metadata/native formats, legacy Coordinator and Nereids ThriftPlansBuilder, plus row-id fetch.
- Special conditions: the batch switch is checked before capability/estimate work; cancellation remains terminal before cache-to-SDK fallback. Physical manifest recovery and scan-local conversion have concrete schema-evolution triggers. No speculative success recovery was identified.
- Test coverage: reviewed shared-load success/failure/invalidation, bounded windows/completion order, queue admission/wakeups, cancellation and permit/owner release, retries, immutable adaptation, serialization and functional suites. Concurrency tests use explicit coordination. Builds, tests and external-service scenarios were not run under this static-only contract.
- Changed results: checked Hive fixture aggregates/order and all new Iceberg cold/warm/queue-capacity tags. Iceberg IDs 0..191 give count/distinct/sum 192/192/18336 and UNION ALL 384/36672. No inconsistent expected result was found; the diff alone cannot certify how output files were generated.
- Observability: pool/group/queue/active/completed metrics and existing scan profiles remain available; manifest counters support concurrent loads and failures retain context. No demonstrated observability omission remains.
- Transactions and persistence: no EditLog, commit protocol or failover mechanism changes. Scope teardown preserves existing transaction-finalization ordering; write-side format inference remains present.
- Data modification, atomicity and crash handling: no new data-write path. Cache generation fences remain in place, partition adaptation does not mutate shared payloads, and read leases preserve active I/O through cleanup.
- FE/BE propagation: no new wire field is needed. Both serialization paths retain file descriptors. Actual BE consumers iterate packed ranges, preserve scanner capacity, prefer each range's format and rebuild row-id fetch projection maps independently.
- Performance: reviewed bounded retention, warm-hit scheduling avoidance, shared-follower worker release, prefix reuse, candidate bounds and batching/compaction. No concrete new hot-path regression was substantiated. Runtime fairness and the PR's benchmark claims were not independently measured.
- Other/core invariants: checked partition recovery, legal promotion families, residual/delete matching, sequence/row-lineage metadata and failure propagation. No new visible-version, MoW/delete-bitmap or BE allocation change is involved, and no additional verified defect remains.
User focus: no additional focus was supplied. All initial risk items and reviewer candidates have explicit dispositions; no changed-path coverage gap or unresolved code candidate remains. Validation is limited to static inspection. Convergence and delivery are reported separately by this invocation's review marker.
Review converged after 2 round(s).
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 28343 ms |
TPC-DS: Total hot run time: 150540 ms |
ClickBench: Total hot run time: 24.06 s |
FE Regression Coverage ReportIncrement line coverage |
What problem does this PR solve?
Issue Number: None
Problem Summary: External scans can monopolize shared FIFO workers, block on metadata submitted to the same pool, repeat path/backend-assignment work, and load cold Iceberg manifests serially. This change uses query-owned bounded task groups, separate split and metadata workers, cooperative continuations and bounded completion-order manifest prefetch. Early stop and exceptions close query-owned tasks and resources, including planning failures before a scan can register its finish callback. Path reuse, bounded consistent-hash candidate lookup and compatible range compaction stay with scheduling to avoid moving the bottleneck into scan bookkeeping. File-format selection and snapshot-specific partition type adaptation preserve per-file semantics without duplicate SDK planning or changes to shared cache values.
Each backend's bounded Split channel wakes on data, completion, cancellation and failure, eliminating the empty terminal request's previous 100 ms polling delay. An earlier four-query JFR reproduction found 78 delayed EOF requests in 400 SQL executions; the fixed path has none in the subsequent replay.
Initial RPC delivery is separate from background lookahead:
split_initial_batch_size(default 64) limits the first response per backend, additionally capped by its request size. Further responses use the BE request size. Producers continue before BE consumption, limited by the configured queues and cooperative fairness. The response bound counts real splits before transport-envelope compaction. There is no producer-side wait for a first BE request.The query-level
enable_external_table_batch_modeswitch is checked at the engine entry before either partition-batch capability checks or file-streaming estimates. Setting it to false consistently selects synchronous planning; previously the partition-batch path could bypass the switch. Provider implementations still determine whether asynchronous planning is supported. Partition/file thresholds and producer/queue defaults are unchanged.Scan-local partition adaptation preserves delete matching after numeric promotion and source-schema cleanup, even when data and delete Manifest entries have different cache warmth. UNKNOWN partition targets use consistent numeric Java representations before delete-key comparison, without rewriting shared cache entries. Regression tests exercise both cache orders, identity/truncate partitions, concurrent historical/current projections and different-partition exclusion.
Split channels and their capacity waiters are indexed by backend ID. This avoids repeatedly hashing and boxing a Backend's endpoint/health fields for each producer batch, which was visible in CPU/alloc flamegraphs at split_batch_size=1. The immutable ID also keeps one bounded channel when a backend handle's metadata changes. Batch generation size, FIFO delivery, backpressure, wakeup ordering, cancellation and fair scheduling are retained. A focused queue/lifecycle suite has 63 passing tests, including three-backend streaming and the same-ID/different-handle capacity-wakeup boundary.
Main benefits and independent SQL measurements
This PR addresses two different concerns: bounded scheduling and query lifecycle correctness, and overlapping cold metadata I/O. Query groups rotate ready work and bound queued tasks; separate SPLIT and METADATA workers avoid parent/child pool starvation; cancellation prevents queued work and cache-to-SDK fallback from restarting a finished query. These are scheduling/resource guarantees, not a claim that every SQL statement becomes faster.
The clearest standalone latency gain is Iceberg cold full scans: approximately 32–34% less complete-SQL time. Hive already has partition-parallel listing, so warm Hive single-query latency remains approximately flat. With the same Linux AArch64 Release BE, one backend, six CPUs, warm BE footer/data cache,
split_batch_size=1andsplit_queue_capacity=4096:Baseline: frozen unoptimized master
e0bf4874070. The standalone measurement package records9b6d902ffa1(built sourced61d21b943abefore its equivalent EOF-fix amendment). Each single-query cell has 40 measured samples across forward/reverse runs after prewarm. Cold means FE catalog/Manifest invalidation, not cold JVM or BE data. These historical measurements predate the subsequent initial-delivery refinements, rebase and review repairs; they establish the standalone implementation's measured benefit and are not a fresh A/B of the current head. The total PR gain includes Manifest prefetch and scan-path improvements; it does not isolate the fairness mechanism itself.The focused initial-delivery experiments below compare two already-optimized FE versions. For example, Hive four-query LIMIT group median improves 15.38 → 11.82 ms (23.1%), while the controlled slow-listing/delayed-BE full scan stays 388.52 → 386.96 ms. These incremental results must not be added to, or substituted for, the standalone master comparison above.
Ready split batches are drained together within each BE request, capped at 64 producer batches and the number that fits the remaining request. This amortizes queue operations and per-batch channel checks without waiting to fill a response or changing producer buffering. Capacity callbacks execute after the queue lock is released; callback-published errors and cancellation are checked before returning the drained data. The scalar path still handles empty queues and partial batches.
A four-phase fixed-Release-BE comparison on a warm 10,000-file Iceberg table narrows single-query batch-one overhead against each phase's batch128 control from 5.8–6.4% to 0.7–2.8%. Four-query full scans show no stable change. The initial four-query LIMIT difference of approximately 1 ms does not reproduce in a separate 3,200-SQL reverse-order repetition; sub-millisecond differences remain noisy. CPU samples inside getNextBatch are essentially unchanged (392 versus 389), while allocation samples fall from 444 to 174, mostly boxing and iterators. These are statistical samples, not exact invocation/byte counts. Across both formal comparisons, 4,800 SQL statements pass result checks; separate cache-hit profiles, Hive correctness and Iceberg cold LIMIT startup checks also pass. Both isolated PR and integration worktrees pass 66 focused unit tests and full build.sh --fe including Checkstyle. This comparison changes only SplitSource.class; plugins and the Release BE are identical.
Release note
External Hive and Iceberg scans support bounded fair task scheduling, query cancellation and concurrent cold Manifest loading. The new
split_initial_batch_sizesession setting controls first-response size independently ofsplit_batch_sizeandsplit_queue_capacity. File formats, pinned snapshots and full-scan results are preserved.Check List (For Author)
Current-head repair validation at
28fb25d01bd:StmtExecutorTestandIcebergManifestReadContextTestpassed (69 tests);build.sh --fe -j4and Checkstyle passed. Earlier review-repair validation at17859e3ff14: 1,521 Iceberg package tests (zero failures/errors, one environment-dependent skip), two query-lifecycle tests, andbuild.sh --fe -j4including Checkstyle passed. Coverage includes cancellation before first scheduler acquisition, all four cache-to-SDK fallback paths, shared query read admission and identity/truncate data/delete manifests after source-schema cleanup. Previously reported live SQL/regression and performance experiments are historical and were not rerun after every review repair. CI status remains tracked by the checks on this PR.build.sh --fe, including Checkstyle; 750 scoped FE/SPI/Hive/Iceberg tests in 53 classes, zero failures/errors/skips. Updated Hive streaming regression and Iceberg scheduled-split regression both passed without skips. Matched Release-BE experiment: 1,200 four-query LIMIT SQL and 150 full scans, all result checked. Separate 400-query RPC/EOF diagnostic; footer/page-cache profile verification.Supporting experiments: initial delivery, full-scan overlap and RPC diagnostics
Focused initial-delivery experiment
Same Linux AArch64 Release BE, one backend, six engine CPUs, warm BE data/footer cache;
num_partitions_in_batch_mode=1,split_batch_size=1,split_queue_capacity=4096. Hive fixture: 1,000 partitions, one file per partition. The reference FE already includes the other scheduling/scan changes. It is the exact FE before the initial-delivery change, not unoptimized master or SR.Each fresh FE follows identical 45-second full-scan/LIMIT prewarm. Four-query LIMIT results have 100 groups / 400 SQL per version, without agents, profilers, builds or unit tests during timing. Every LIMIT length and full COUNT/SUM result is checked. Full scans use 10 measured SQL per cell; cold cells run forward/reverse order.
The cold-listing catalog disables only the file-list cache over the same table, with warmed partition metadata and BE data/footer caches. First-fetch delay is injected at
SplitSource.getNextBatchentry before demand callbacks; the slower-listing case injects 20 ms before each real directory request. These controlled delay-injection measurements include the sleeps and do not represent ordinary production latencies or all resource effects of a slow BE startup.A rejected producer startup barrier had the same LIMIT group median (11.85 ms), but the slower-listing/delayed-fetch full scan took 651.26 ms. Independent initial delivery restores this to 386.96 ms. During the same 300 ms delay, both the pre-change reference and final implementation complete another 896 directory listings (median); the barrier completed zero. The final source contains no startup barrier. The barrier's per-SQL LIMIT median was 10.77 ms versus 11.15 ms now; group mean, p95 and maximum all improve. Both distributions are retained in validation rather than claiming uniform per-SQL improvement.
Separate diagnostic replay of 400 LIMIT SQL has 400 Split RPCs: 399 first responses contain 64 real file ranges and one contains 25. Every first response satisfies the bound, with no extra RPC needed in these LIMIT cases and no delayed EOF request. Diagnostic query timings are excluded from the table. A full-scan profile records 1,000 footer hits / zero footer reads and 1,000 page hits / zero page misses.
Backend candidate lookup was independently measured with production ConsistentHash/Backend classes, 256 virtual nodes, JDK17/macOS ARM64: 0.21–0.26 microseconds at 2–128 backends, including four threads. That is a function benchmark, not multi-backend complete SQL. No SR performance matrix was rerun. The subsequent Iceberg matrix is recorded below with its own fixed BE identity.
Iceberg first-delivery follow-up
Matched previous/current FE (
3b97eee547c/3e94facccfb), keeping the same Linux AArch64 Release BE throughout the timed runs (SHA256 prefix26a52681f1ed). Only initial-delivery behavior differs between these FE variants; the rest of the implementation is held fixed. This BE differs from the one used in the Hive table above, so absolute values should not be mixed between the tables.Doris Manifest Cache enabled; SDK manifest cache disabled. Both use producer batch1, queue4096, manifest concurrency8, pruningfalse. Cold means catalog/manifest invalidation with hot BE data/footer caches and warm JVM. Before each cold four-query group, invalidate exactly once, outside timing; all four then run concurrently. Previous groups' background tasks drain first. Every COUNT/SUM and LIMIT length is checked. Single-query40 samples/cell; four-query30 groups/cell, forward/reverse order.2560 measured SQL.
Warm LIMIT improves17–20% single-query and26–30% group completion. Cold LIMIT is near-flat. Some full-scan points increase1–3.5%, which are disclosed rather than calling all cases faster.
An additional same-JVM parameter-only ABBA comparison (cap64 versus unlimited,20 samples/groups per mode/cell;1600 SQL) shows full scans mostly within-1.2% to+2.1%. Its1000-manifest cold single full scan had one13.6% median increase; a focused random-order repetition of50 samples/mode did not reproduce it (unlimited223.60ms versus64's223.25ms). The median-difference bootstrap95% interval is-12.90 to+8.28ms. These runs do not establish zero overhead or equal tails; they did not reproduce a consistent large full-scan regression. No product code change is made from the small mixed differences.
Separate diagnostics directly count actual Manifest-cache loader executions: cold100/1000, warm0/0. Both full-scan profiles show10000 footer hits/zero footer reads and10000 page hits/zero misses. No agent, profiler, build or UT runs during the4260 measured SQL. Supplementary RPC diagnostics are excluded from the timing claims.
Focused multi-backend small-batch follow-up
Balanced assignments now consult the existing weight-count index before constructing redistribution heaps. Successful offers and consumers with no capacity waiter bypass the query-wide capacity monitor. On a failed offer, callback registration precedes the retry under that monitor, preserving wakeups when capacity is released before registration. Listener-set mutations and error fanout remain protected, and callbacks execute outside the monitor.
A four-phase previous/current FE experiment holds the remaining code fixed and alternates reference/current/current/reference packages. The fixed Linux AArch64 Release BE uses three backends, two configured cores each, a shared six-CPU budget, 4 GiB per BE and footer-cache capacity 20000. Both variants use partition/file thresholds 1, initial response 64, producer batch1 and queue4096. All 3200 measured SQL results pass; each table cell has 80 queries/groups. Separate profiles verify zero footer reads and zero page misses on every backend. No profiler, agent, build or unit test overlaps timing.
The demonstrated benefit is reduced FE resource/lock cost: equal-workload sampling of 240 full scans reduces active CPU samples from 6385 to 4373 (31.5%) and allocation samples from 39174 to 25396 (35.2%). Recorded accumulated waits at capacity notification fall from 295.112 ms to zero above the 10-us recording threshold. Samples and accumulated parallel waits are not complete-SQL time. Full scans remain approximately flat, with the four-query median increasing 1.0%; this experiment does not establish an end-to-end full-scan speedup. The current same-version batch128/queue32 control takes 152.504 ms for four-query full scans, leaving 5.5% batch1 overhead. LIMIT is preserved. Batch128 LIMIT controls also improve in this experiment, so the full observed LIMIT difference should not be attributed solely to batch1 handling.
Both isolated PR and integration worktrees pass 120 focused policy/split/concurrency tests and full FE build/Checkstyle. Added tests cover redistribution across cumulative weight thresholds, monitor-independent uncontended paths and deterministic capacity release before waiter registration. Source and modified-class identities match between the independently built worktrees. Configuration defaults remain unchanged.