Skip to content

fix(plugin-redis): Cluster over SSH fails with wrong advice and typed SCAN drops its cursor - #3190

Merged
datlechin merged 3 commits into
mainfrom
fix/redis-cluster-tunnel-and-scan
Sep 30, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/redis-cluster-tunnel-and-scan

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • Redis Cluster through a tunnel (SSH, Cloudflare, SOCKS, Tunnel Command or Cloud SQL Proxy) failed to connect with advice to set Connection Mode to Cluster. Root cause: every tunnel rewrites a Redis connection to Standalone against the first host, and RedisTopologyDiagnostics.mismatch only honored isTunneled for a Sentinel node, so a cluster data node fell through to the "set Connection Mode to Cluster" refusal the user could never satisfy.
  • A SCAN typed in a query tab showed one page of keys with no way to continue, and an empty mid-scan page showed only "No rows". Root cause: buildScanPageResult never read page.cursor, so the next cursor from the SCAN reply was dropped before the result reached the status bar.

The unfinished page is deliberately not marked truncated: isTruncated shows Fetch All, which re-runs the same SCAN <cursor> text and would return the same page. The cursor goes out as the result's status message instead, and a cluster cursor is shown whole (<node id>-<cursor>) so it can be passed back to SCAN.

Tests

  • RedisTopologyDiagnosticsTests/clusterThroughTunnelIsFine: spec change, now passes actual: .cluster (the old version passed .standalone and never tested the cluster case). Fails without the fix.
  • RedisTopologyDiagnosticsTests/standaloneThroughTunnelIsFine: new, keeps the case the old test covered.
  • RedisKeyspacePageTests (new, 9 cases): unfinishedPageNamesNextCursor, finishedPageHasNoNotice, emptyUnfinishedPageNamesNextCursor, clusterCursorIsNamedWhole, and the RedisScanPageOutcome cases unfinishedPageOutcomeCarriesCursorWithoutTruncating, emptyUnfinishedPageOutcomeCarriesCursor, finishedPageOutcomeHasNoStatusMessage, pageOverRowLimitIsCappedAndTruncated, incompletePageIsTruncated. They fail without the fix: the target does not compile, because nothing on the page carries the cursor.
  • 12 Redis suites, 79 cases, all passing.

Docs

The docs rewrite branch covers the user-facing text for both changes.

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin
datlechin merged commit 0a73c8c into main Sep 30, 2026
4 checks passed
@datlechin
datlechin deleted the fix/redis-cluster-tunnel-and-scan branch September 30, 2026 01:05
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