Skip to content

Conversation

chakaz
Copy link
Contributor

@chakaz chakaz commented Nov 24, 2024

Part of #4173 (see for context)

This fixes:

  • CLUSTER NODES
  • CLUSTER SHARDS
  • CLUSTER SLOTS

But only for emulated cluster mode. @romange - should we also handle real cluster (in a future PR)?

@chakaz chakaz requested a review from romange November 24, 2024 10:20
async def test_emulated_cluster_with_replicas(df_factory):
master = df_factory.create(port=BASE_PORT)
master = df_factory.create(port=BASE_PORT, admin_port=BASE_PORT + 1000)
replicas = [df_factory.create(port=BASE_PORT + i, logtostdout=True) for i in range(1, 3)]

df_factory.start_all([master, *replicas])

c_master = aioredis.Redis(port=master.port)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use master.client() and master.admin_client() instead of explicit aioredis.Redis. the latter handles the closing of the connections automatically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
I had to make some changes to follow up on that, because the clients are configured slightly differently (utf8 decoding)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, you get it built in.

@romange
Copy link
Collaborator

romange commented Nov 24, 2024

@chakaz yes, we should do the same for real cluster in future PRs.

@romange
Copy link
Collaborator

romange commented Nov 24, 2024

LGTM

@chakaz chakaz requested a review from romange November 24, 2024 12:35
Copy link
Collaborator

@romange romange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping out with this!

@chakaz chakaz enabled auto-merge (squash) November 24, 2024 13:00
@chakaz chakaz merged commit 6a7f345 into main Nov 24, 2024
9 checks passed
@chakaz chakaz deleted the chakaz/managed-info branch November 24, 2024 13:10
romange pushed a commit that referenced this pull request Nov 24, 2024
* chore: Hide replicas from `CLUSTER` subcmds in managed mode

Part of #4173 (see for context)

* server.client()
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.

2 participants