Skip to content

fix: Make HttpLoadQueuePeon degrade gracefully instead of throwing on fetch failure - #20128

Open
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:fix-httpLoadQueuePeon-degraded-fetch
Open

fix: Make HttpLoadQueuePeon degrade gracefully instead of throwing on fetch failure#20128
waterWang wants to merge 1 commit into
apache:masterfrom
waterWang:fix-httpLoadQueuePeon-degraded-fetch

Conversation

@waterWang

Copy link
Copy Markdown

Description

Fixes #19950

When a historical server returns a non-200/404 response or is unreachable
during fetchSegmentLoadingCapabilities(), the HttpLoadQueuePeon constructor
throws an RE. This exception propagates through
LoadQueueTaskMaster.resetPeonsForNewServers() into
PrepareBalancerAndLoadQueues, which is the first duty in the
HistoricalManagementDuties group. The top-level
DruidCoordinator.DutiesRunnable.run() catches and logs the exception, but
segment management (loading, balancing, handoffs) stops entirely for all
servers — not just the unhealthy one. Ingestion tasks back up waiting for
handoff.

Changes

  • fetchSegmentLoadingCapabilities(): Instead of throwing RE on non-200/404
    responses or any Throwable, return default SegmentLoadingCapabilities
    derived from the configured batch size, with a warning log. The peon is still
    created, the server is still managed with conservative defaults, and the rest
    of the duty group proceeds normally.
  • Mirror the existing 404 branch's fallback behavior (already returned default
    capabilities).

Key design decisions

  • The 404 branch already existed and returned default capabilities. The fix
    extends this same graceful degradation to non-200 responses and exceptions.
  • log.makeAlert() is preserved for non-200 responses so operators still get
    alerted about the unhealthy server.
  • The catch block now logs a warning instead of throwing, keeping the
    Coordinator ticking.

Release notes

Fixed a bug where a single unhealthy or unreachable historical server could
stall all segment loading and balancing across the cluster.

… fetch failure

When a historical server returns a non-200/404 response or is unreachable,
fetchSegmentLoadingCapabilities() throws an RE, which propagates through
LoadQueueTaskMaster.resetPeonsForNewServers() into PrepareBalancerAndLoadQueues.
The top-level DruidCoordinator.DutiesRunnable.run() catches and logs it, but
segment management stops entirely for ALL servers — not just the unhealthy one.

Fix: degrade gracefully by returning default SegmentLoadingCapabilities derived
from the configured batch size, with a warning log. The peon is still created,
the server is still managed with conservative defaults, and the rest of the
duty group proceeds normally.
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