Skip to content

[Experimental] Multiple head node support using raft consensus algorithm - #51781

Closed
pavelkushtia wants to merge 0 commit into
ray-project:masterfrom
pavelkushtia:ssiddique/multi_head_node
Closed

pavelkushtia wants to merge 0 commit into
ray-project:masterfrom
pavelkushtia:ssiddique/multi_head_node

Conversation

@pavelkushtia

Copy link
Copy Markdown

Why are these changes needed?

Related issue number

Checks

@pavelkushtia
pavelkushtia requested review from a team, kevin85421 and pcmoritz as code owners March 28, 2025 01:58
@jcotant1 jcotant1 added the core Issues that should be addressed in Ray Core label Mar 29, 2025
@hainesmichaelc hainesmichaelc added the community-contribution Contributed by the community label Apr 4, 2025

@aslonnie aslonnie 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.

please fix the merge base.

@pavelkushtia
pavelkushtia marked this pull request as draft April 7, 2025 22:59
@pavelkushtia pavelkushtia changed the title Multiple head node support using raft consensus algorithm [Experimental] Multiple head node support using raft consensus algorithm Apr 7, 2025
@pavelkushtia
pavelkushtia force-pushed the ssiddique/multi_head_node branch from 11f2066 to 1a2edec Compare April 8, 2025 00:43
nadongjun added a commit to nadongjun/ray that referenced this pull request Aug 10, 2026
…events

Round of fixes from the first CI run (microcheck ray-project#51781) and the bot reviews
on ray-project#65298.

Teardown crash (CI: gcs_client_test SIGSEGV, 2 out of 2). When an io_context
is destroyed with redis work still queued, boost::asio destroys the pending
handlers without running them. One of those handlers held the last owner of
the RedisStoreClient, so its destruction tore down the RedisContext, whose
raw hiredis context was still REDIS_CONNECTED because the loop never got to
process the drop. redisAsyncFree then flushed the pending command callbacks,
and the retry path scheduled a timer on the io_context that was mid-
destruction. RedisRequestContext now carries a token that expires with its
RedisAsyncContext; a flushed callback that finds it expired drops the request
instead of scheduling anything.

AUTH verified before a reconnect is declared (Cursor review, and it made a
row in the PR's verification table wrong). Startup proves credentials on a
synchronous probe before anything async happens; the reconnect path had no
probe and sent AUTH fire-and-forget, so a promoted primary that rejects the
credentials still logged "Reconnected" and then bled the command budget on
-NOAUTH replies. The reconnect's AUTH now carries a reply callback: an error
reply tears the fresh connection down (redisAsyncDisconnect, the teardown
that is legal from inside a hiredis callback) and the disconnect path retries;
only a clean reply completes the episode. The TCP connect callback defers to
it through auth_pending_.

Retries driven by failure events instead of a poll (Gemini review). The
retry timer used to re-arm unconditionally, so while a connect was in flight
it woke up, saw the pending flag, and re-armed: a poll. Now a sync connect
failure schedules the retry on the spot, an async failure schedules it from
the disconnect callback, and a success arms nothing. The epoch guard still
kills timers orphaned by an episode that ended in success.

Log flood (CI: 26,244 identical ERROR lines in one test). During an outage
every in-flight command fails once per backoff step, and with the grace
period holding their budgets nothing is even being spent. Refunded failures
now log at WARNING, rate-limited to one line per second; failures that do
spend budget keep the per-command ERROR.

test_redis_failureover asserts that gcs_server exits promptly when the
Redis Cluster node it is pointed at goes away, which is exactly the
documented-unsupported topology, so the test now pins
redis_reconnect_grace_period_ms=0 to keep the old exit semantics it is
built around. test_redis_with_sentinel_failureover polls with a 2s interval
so the 120s wait does not spawn a driver process per 100ms (Gemini review).

The gcs_client_test thread_checker failure in CI attempt 2 reproduces
locally only under parallel test load and its stack has no redis frames
(TearDown polls the io_context on the main thread and a queued
GcsActorManager callback trips its thread checker); it predates this stack.

Signed-off-by: Dongjun Na <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-backlog community-contribution Contributed by the community core Issues that should be addressed in Ray Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants