Skip to content

Limit Redis proxy ElasticKV pool - #1073

Merged
bootjp merged 1 commit into
mainfrom
fix/redis-proxy-elastickv-pool-limit
Jul 12, 2026
Merged

Limit Redis proxy ElasticKV pool#1073
bootjp merged 1 commit into
mainfrom
fix/redis-proxy-elastickv-pool-limit

Conversation

@bootjp

@bootjp bootjp commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • lower the default ElasticKV backend pool for redis-proxy to 4 connections
  • add -elastickv-pool-size so operators can tune the pool with the cluster per-peer limit
  • document the new option in deployment examples and HA compose

Root cause

The redis-proxy ElasticKV backend used the generic go-redis pool default of 128 connections, while ElasticKV Redis adapter defaults to 8 concurrent connections per peer. Under dual-write load from a single proxy host, new connections from that host exceeded the adapter cap and surfaced as EOF / connection reset / broken pipe errors during secondary writes and leader probes.

Validation

  • GOCACHE=$(pwd)/.cache GOTMPDIR=$(pwd)/.cache/tmp go test ./cmd/redis-proxy ./proxy
  • pre-fix runtime check on 192.168.0.64 showed recent proxy reset spam and INFO replication returning ERR max connections per client exceeded from 192.168.0.210

Summary by CodeRabbit

  • 新機能

    • プライマリおよび ElasticKV バックエンドの接続プールサイズを設定できるようになりました。
    • 不正なプールサイズや未知の実行モードを検出し、エラーを表示します。
    • HA 構成で ElasticKV 接続プールサイズを環境変数から変更できるようになりました。
  • ドキュメント

    • Docker、Docker Compose、HA 構成の設定例に新しいオプションを追加しました。

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a061193d-6cb8-42a9-a2f7-fee43abd4c3f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

RedisプロキシにRedisおよびElasticKVの接続プールサイズ指定を追加し、正値検証とバックエンド設定への反映を実装しました。Docker Compose、README、デプロイメントドキュメントの例も更新しています。

Changes

接続プールサイズ設定

Layer / File(s) Summary
ElasticKVバックエンドのデフォルト設定
proxy/backend.go, proxy/proxy_test.go
ElasticKV用のデフォルトプールサイズを追加し、タイムアウト設定とともに戻り値をテストします。
実行時オプションの解析と適用
cmd/redis-proxy/main.go
-primary-pool-size-elastickv-pool-size を追加し、モードおよびプールサイズを検証して各バックエンドへ反映します。
デプロイ設定と利用例
deploy/redis-proxy/docker-compose.ha.yml, README.md, docs/redis-proxy-deployment.md
Docker Composeの環境変数上書きと、各種docker run・Compose・HA設定例にElasticKVプールサイズを追加します。

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed ElasticKV の接続プール上限を下げる主変更を簡潔に表しており、変更内容と一致しています。
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bootjp
bootjp marked this pull request as ready for review July 12, 2026 08:53
@bootjp

bootjp commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces configurable connection pool sizes for both the primary Redis and secondary ElasticKV backends. It adds new command-line flags -primary-pool-size and -elastickv-pool-size, validates that these pool sizes are positive, and integrates them into the proxy configuration. Additionally, it documents these new options in the README and deployment documentation, and adds corresponding unit tests. There are no review comments, and the changes look solid, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@bootjp
bootjp enabled auto-merge July 12, 2026 09:01
@bootjp
bootjp merged commit acf3337 into main Jul 12, 2026
11 checks passed
@bootjp
bootjp deleted the fix/redis-proxy-elastickv-pool-limit branch July 12, 2026 09:02
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