Skip to content

fix(http): say when a cursor or cancel reached the wrong node; add https sessionAffinity - #355

Closed
IronicRayquaza wants to merge 1 commit into
hydra-db:mainfrom
IronicRayquaza:fix/http-cursor-affinity
Closed

IronicRayquaza wants to merge 1 commit into
hydra-db:mainfrom
IronicRayquaza:fix/http-cursor-affinity

Conversation

@IronicRayquaza

@IronicRayquaza IronicRayquaza commented Nov 27, 2026 •

Copy link
Copy Markdown

Summary

This is the small option from #327. It documents the affinity requirement, makes the errors say what went wrong, and adds a chart option for the proxy-less multi-replica case. It does not change routing, so the node-id routing idea in the issue stays open for later.

Errors (src/client/service.rs). The old text is kept as a prefix, so existing substring matches still work.

  • result cursor is unknown or expired on this node; a cursor lives only on the node that served the first page, so send every page of a scan to that node
  • no active query with id … was cancelled on this node; a query can only be cancelled on the node that runs it

Chart

  • service.https.sessionAffinity (None | ClientIP, default None) and sessionAffinityTimeoutSeconds (default 10800, the Kubernetes default). With ClientIP, the -https Service renders sessionAffinity / sessionAffinityConfig. With the default, the rendered output is unchanged.
  • Schema: https is now allOf the shared service definition plus these two keys, so a bad value fails helm template.
  • A comment on proxy.readRouting says that fleet re-routes every page request, and recommends owner for clients that page HTTP results or cancel reads.

Docs. USING-HYDRADB.md (Pagination and the cancel bullet) and the chart README say that cursors and running queries live on one node. They name the setting to use: ClientIP with the proxy off, readRouting: owner with it on.

Testing

  • helm lint hydradb -f ci/ci-values.yaml passes.
  • helm template with default values renders no sessionAffinity.
  • With --set service.https.sessionAffinity=ClientIP --set service.https.sessionAffinityTimeoutSeconds=600, it renders sessionAffinity: ClientIP and timeoutSeconds: 600.
  • sessionAffinity=Sticky is rejected by the schema.
  • rustfmt --check (edition 2021, repo rustfmt.toml) passes on service.rs. No test asserts on the full text of either error.

Linked issue

Closes #327

AI Assistance

Model Effort
Claude Opus 5.5 Low

Checklist

  • Implements an issue a maintainer has /approved.
  • Small and scoped to that issue.
  • Breaking changes described below, or none.

Breaking changes

None. Error messages gain a suffix, and the old text is unchanged as a prefix. The chart output is unchanged unless sessionAffinity: ClientIP is set.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…tps sessionAffinity

HTTP result cursors and running queries live in one node's memory, but
nothing keeps a client's follow-up page or cancel on that node. The
errors only said "unknown or expired" / "was cancelled".

- Errors now say "on this node" and that the request must reach the node
  that served the first page or runs the query. The old text is kept as a
  prefix.
- Chart: service.https.sessionAffinity (None | ClientIP) and
  sessionAffinityTimeoutSeconds for the proxy-less multi-replica case.
  Default output is unchanged.
- Docs: USING-HYDRADB.md and the chart README explain the requirement and
  point to ClientIP (proxy off) or proxy.readRouting: owner (proxy on).

Refs hydra-db#327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@IronicRayquaza
IronicRayquaza requested a review from a team November 27, 2026 09:50
@github-actions

Copy link
Copy Markdown

This is PR 1 of 3 you may keep open at a time.

@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

@github-actions github-actions Bot closed this Nov 27, 2026
@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

1 similar comment
@github-actions

Copy link
Copy Markdown

This PR has no linked approved issue. Open an issue, get it discussed and /approved by a maintainer, then link it here with Closes #N. Closing for now; reopen once linked. (Fastest help: the #pr-discussion channel on Discord.)

Maintainers: reopen this PR to override the gate (it gets the gate-override label).

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.

HTTP paging and cancel reach a node that does not hold the cursor or the running query

1 participant