Skip to content

Make segment-replace timeouts and endReplaceSegments convergence wait configurable - #19278

Open
shounakmk219 wants to merge 1 commit into
apache:masterfrom
shounakmk219:configurable-timeouts
Open

Make segment-replace timeouts and endReplaceSegments convergence wait configurable#19278
shounakmk219 wants to merge 1 commit into
apache:masterfrom
shounakmk219:configurable-timeouts

Conversation

@shounakmk219

Copy link
Copy Markdown
Collaborator

Summary

Minion → controller segment-replace requests (startReplaceSegments / endReplaceSegments / segment upload) can run for a long time. In particular, the controller handles endReplaceSegments synchronously, blocking on IdealState → ExternalView convergence, which for large tables can take many minutes. Several of the governing timeouts were hard-coded, so the client socket timeout and the controller-side work time could not be aligned per deployment.

This change exposes those knobs as configuration, all with backward-compatible defaults (no behavior change unless configured).

Controller convergence wait (PinotHelixResourceManager.endReplaceSegments)

Previously hard-coded (// TODO: make this configurable). Now read from controller config:

Config key Default
controller.segment.replace.externalViewMaxWaitMs 600000 (10 min)
controller.segment.replace.externalViewCheckIntervalMs 1000 (1 s)
controller.segment.replace.maxRetryAttempts 5

The values are resolved once from ControllerConf (falling back to the existing static constants), and the retry policy wrapping endReplaceSegments is built from the configured attempt count.

Minion client socket timeouts

  • pinot.minion.startReplaceSegments.timeoutMs (new, default 10 min) — wired through SegmentConversionUtils.startSegmentReplace (new socketTimeoutMs overload) and BaseMultipleSegmentsConversionExecutor.
  • segmentUploadRequestTimeoutMs task config (new, default 10 min) — read inside SegmentConversionUtils.uploadSegment, alongside the existing retry knobs.
  • endReplaceSegments timeout was already configurable (pinot.minion.endReplaceSegments.timeoutMs).

HttpClient

HttpClient.sendRequest now sets an explicit connection-request (pool checkout) timeout instead of silently inheriting the Apache HttpClient default, so a saturated pool cannot block a replace/upload request unboundedly. The TCP connect timeout remains tunable via the existing http.client.connectionTimeoutMs.

Testing

  • ControllerConfTest — defaults and overrides for the three new controller keys.
  • MinionConfTest — defaults/overrides for the start/end replace-segments timeouts.
  • mvn spotless:apply checkstyle:check license:check clean on all touched modules.

🤖 Generated with Claude Code

… configurable

Expose the previously hard-coded socket/convergence timeouts on the minion
segment-replace path as configuration, with backward-compatible defaults:

- Controller: the endReplaceSegments IdealState -> ExternalView convergence
  wait, poll interval, and retry-attempt count are now read from controller
  config (controller.segment.replace.externalViewMaxWaitMs /
  .externalViewCheckIntervalMs / .maxRetryAttempts), defaulting to the prior
  hard-coded 10min / 1s / 5.
- Minion: the startReplaceSegments and segment-upload socket timeouts are now
  configurable (pinot.minion.startReplaceSegments.timeoutMs and the
  segmentUploadRequestTimeoutMs task config); the endReplaceSegments timeout
  was already configurable.
- HttpClient.sendRequest now sets an explicit connection-request (pool
  checkout) timeout instead of silently inheriting the Apache HttpClient
  default.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@shounakmk219 shounakmk219 added the configuration Config changes (addition/deletion/change in behavior) label Aug 17, 2026
@jineshparakh

Copy link
Copy Markdown
Contributor

@shounakmk219 do you think it makes sense to have these configs hot reloadable? I think we should do it.

@shounakmk219

Copy link
Copy Markdown
Collaborator Author

@shounakmk219 do you think it makes sense to have these configs hot reloadable? I think we should do it.

That's a good point @jineshparakh, I wanted to have them hot reloadable as well but currently there is no place in PinotHelixResourceManager where we can listen to cluster config changes and apply them. Creating new tooling felt like over kill for the timeouts which are rarely touched

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

Labels

configuration Config changes (addition/deletion/change in behavior)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants