Skip to content

Limit Edge query threads and remove unused binary allocator - #18587

Open
JackieTien97 wants to merge 1 commit into
apache:masterfrom
JackieTien97:ty-edge-query-thread-limits
Open

Limit Edge query threads and remove unused binary allocator#18587
JackieTien97 wants to merge 1 commit into
apache:masterfrom
JackieTien97:ty-edge-query-thread-limits

Conversation

@JackieTien97

@JackieTien97 JackieTien97 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Description

Edge still creates query scheduling notifications through an unbounded cached pool, while fragment dispatch uses a hard-coded minimum of 20 workers. Add restart-only settings and set both Edge defaults to 2:

Setting General default Edge default
driver_task_scheduler_notification_thread_count 0: retain the existing unbounded cached pool 2
fragment_instance_dispatch_thread_count 0: use max(20, available processors × 2) 2

Positive notification sizes queue callbacks on a limited worker pool; workers can exit after 60 seconds of inactivity. Callbacks do not fall back to the threads completing driver futures. Fragment dispatch retains its existing caller-runs behavior when the pool is busy. Negative configuration values are rejected.

Remove the unused BinaryAllocator implementation, its configuration, metrics and lifecycle hooks. Repository-wide call-site inspection found allocation/deallocation calls only in its unit tests; production references merely started it through GC monitoring or configuration reload. The old auto-releaser could remain blocked in ReferenceQueue.remove() after shutdown, accumulating threads across restarts. Removing the unused subsystem prevents those workers from being created. Normal BLOB handling remains covered by the real Edge read/write test.

ConfigNode and SchemaRegion continue to use Ratis; DataRegion continues to use IoTConsensus.

Validation

Validated after rebasing onto master (4f2eb0c790):

  • Clean distribution build; all six distribution artifacts produced. The packaged node-commons jar contains no binaryallocator classes.
  • Four unit tests passed: configuration defaults/validation/startup/restart-only behavior, driver scheduling, and 12 blocked-driver notifications completing through two workers without executing on the completing thread.
  • Seven IoTDBEdgeBasicIT tests passed, including tree/table reads and writes, concurrent table queries, 40 cross-database join queries across four concurrent connections, consensus assertions, and a 64 KiB BLOB verified before/after flush and configuration reload.
  • Edge starts and reloads a configuration retaining the legacy enable_binary_allocator=true key. The thread dumps contain no BinaryAllocator workers. The cross-database join dump contains two fragment-dispatch workers and two driver-notification workers.
  • Full-reactor English and Chinese test compilation passed.

@JackieTien97
JackieTien97 changed the base branch from rc/2.0.11 to master September 6, 2026 00:54
@JackieTien97
JackieTien97 force-pushed the ty-edge-query-thread-limits branch from e4415a0 to 4f2eb0c Compare September 6, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant