Skip to content

[2.4pick][core] Improve the workflow finding Redis leader. (#34108) - #34183

Merged
clarng merged 1 commit into
ray-project:releases/2.4.0from
fishbone:cherry-pick-34108
Apr 11, 2023
Merged

clarng merged 1 commit into
ray-project:releases/2.4.0from
fishbone:cherry-pick-34108

Conversation

@fishbone

@fishbone fishbone commented Apr 8, 2023

Copy link
Copy Markdown
Contributor

The current way of finding Redis leader sometimes giving error information. The main reason is because the ip address is not resolved.

If in the initialization stage, it connect to the master, it'll use passed in address as the leader which later might make Ray pick follower redis.

This PR fixed the issue and also uses the way redis-cli used to pick the leader.

The PR makes the checking more strict to give better error message. New protocol as below:

  • use boost to resolve the ip address from domain name.
  • connect to the first ip address
  • if it's cluster mode,
    • make sure it's healthy; make sure only 1 shard
    • send a dummy write and check the return
      • if return OK, use the ip address directly
      • otherwise, use the one mentioned in the error message
  • if not cluster mode, just use the ip address

Refactoring is also done in this PR. Moving connection related information to redis context

Why are these changes needed?

Related issue number

Checks

@fishbone
fishbone requested a review from a team as a code owner April 8, 2023 00:04
@fishbone fishbone added Ray 2.4 release-blocker P0 Issue that blocks the release labels Apr 8, 2023
@fishbone fishbone changed the title [core] Improve the workflow finding Redis leader. (#34108) [2.4][core] Improve the workflow finding Redis leader. (#34108) Apr 8, 2023
@clarng

clarng commented Apr 8, 2023

Copy link
Copy Markdown
Contributor

are the failing tests just flakey?

@fishbone fishbone changed the title [2.4][core] Improve the workflow finding Redis leader. (#34108) [2.4pick][core] Improve the workflow finding Redis leader. (#34108) Apr 10, 2023
The current way of finding Redis leader sometimes giving error information. The main reason is because the ip address is not resolved.

If in the initialization stage, it connect to the master, it'll use passed in address as the leader which later might make Ray pick follower redis.

This PR fixed the issue and also uses the way redis-cli used to pick the leader. 

The PR makes the checking more strict to give better error message. New protocol as below:

- use boost to resolve the ip address from domain name.
- connect to the first ip address
- if it's cluster mode, 
  - make sure it's healthy; make sure only 1 shard
  - send a dummy write and check the return
    - if return OK, use the ip address directly
    - otherwise, use the one mentioned in the error message
- if not cluster mode, just use the ip address

Refactoring is also done in this PR. Moving connection related information to redis context
@fishbone
fishbone force-pushed the cherry-pick-34108 branch from 25ddc43 to 1a4cc32 Compare April 10, 2023 19:45
@fishbone

Copy link
Copy Markdown
Contributor Author

I think so. maybe just let me rebase to the 2.4.0

@clarng

clarng commented Apr 11, 2023

Copy link
Copy Markdown
Contributor

Btw looks like some test failure is related, but since it doesn't on master I'll assume if is flakey, and if not will open a new issue

//python/ray/tests:test_redis_tls TIMEOUT in 3 out of 3 in 60.4s

  | Stats over 3 runs: max = 60.4s, min = 60.4s, avg = 60.4s, dev = 0.0s
  | /root/.cache/bazel/_bazel_root/5fe90af4e7d1ed9fcf52f59e39e126f5/execroot/com_github_ray_project_ray/bazel-out/k8-opt/testlogs/python/ray/tests/test_redis_tls/test.log
  | /root/.cache/bazel/_bazel_root/5fe90af4e7d1ed9fcf52f59e39e126f5/execroot/com_github_ray_project_ray/bazel-out/k8-opt/testlogs/python/ray/tests/test_redis_tls/test_attempts/attempt_1.log
  | /root/.cache/bazel/_bazel_root/5fe90af4e7d1ed9fcf52f59e39e126f5/execroot/com_github_ray_project_ray/bazel-out/k8-opt/testlogs/python/ray/tests/test_redis_tls/test_attempts/attempt_2.log

@clarng
clarng merged commit 5ca1b8c into ray-project:releases/2.4.0 Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-blocker P0 Issue that blocks the release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants