Skip to content

feat(server): add support for Redis clusters - #76

Merged
alecthomas merged 1 commit into
mainfrom
aat/redis-cluster-storage
Oct 28, 2026
Merged

alecthomas merged 1 commit into
mainfrom
aat/redis-cluster-storage

Conversation

@alecthomas

Copy link
Copy Markdown
Collaborator

The SPECTRE server could store divergences only in a single Redis server. This adds support for a Redis Cluster.

  • --storage selects cluster mode with the redis-cluster:// and rediss-cluster:// schemes. Further seed nodes go in addr query parameters, such as redis-cluster://localhost:7000?addr=localhost:7001. go-redis parses single-node and cluster URLs with the same redis and rediss schemes, so a separate scheme is needed to choose between them.
  • A cluster client cannot talk to a standalone Redis server, so plain redis:// URLs keep using the single-node client.
  • The store holds a go-redis UniversalClient, which both clients satisfy. Every command touches the one divergences key, which lives in a single slot, so WATCH transactions work unchanged in a cluster.
  • A cluster URL with a database path is rejected, because go-redis would otherwise ignore the path and silently use database 0.

The tests run the shared store tests and Open against a cluster client. They use miniredis, which acts as a one-node cluster owning every slot. As a result, redirects between nodes are not exercised.

This is stacked on #75.

🤖 Generated with Claude Code

Base automatically changed from aat/storage-url to main October 28, 2026 11:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alecthomas
alecthomas force-pushed the aat/redis-cluster-storage branch from 236f761 to 613551b Compare October 28, 2026 11:19
@alecthomas
alecthomas marked this pull request as ready for review October 28, 2026 11:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T11:20:42.386431Z 613551b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alecthomas
alecthomas merged commit a51ddf0 into main Oct 28, 2026
6 checks passed
@alecthomas
alecthomas deleted the aat/redis-cluster-storage branch October 28, 2026 11:24
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