Skip to content

feat(python): make rdma get/set available in python glide-sync - #2

Closed
anitarua wants to merge 20 commits into
feat/rdma-3-ffi-integrationfrom
feat/rdma-4-python-sync
Closed

anitarua wants to merge 20 commits into
feat/rdma-3-ffi-integrationfrom
feat/rdma-4-python-sync

Conversation

@anitarua

@anitarua anitarua commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is a continuation of the work to add client support for a new Valkey module for remote direct memory access (RDMA). This PR makes the glide-rdma features available in the Python glide-sync client, which will be used in KV caching adapters (e.g. LMCache and vLLM).

Issue link

This Pull Request is linked to issue: ValkeyLargeObj Large-Object Module
Closes valkey-io#4743

Features / Behaviour Changes

Introduces RdmaConfiguration, register_rdma_region, rdma_set, rdma_get, region.close, and other functions for memory management.

Implementation

The new configuration options are in python/glide-shared/glide_shared/config.py.
The bulk of the implementation is in python/glide-sync/glide_sync/glide_client.py.
Updated .github/workflows/pypi-cd.yml to build the python release with the RDMA feature turned on.

Limitations

RDMA not supported in pooled clients or async clients.

Testing

New tests in the python/tests directory and I've tested the full client integration against the module on real efa hardware.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one issue.
  • Commit message has a detailed description of what changed and why.
  • Tests are added or updated.
  • CHANGELOG.md and documentation files are updated.
  • Linters have been run (make *-lint targets) and Prettier has been run (make prettier-fix).
  • Destination branch is correct - main or release
  • Create merge commit if merging release branch into main, squash otherwise.
  • Make sure to update the documentation in the valkey-glide-docs repository if necessary

@anitarua anitarua changed the title Feat/rdma 4 python sync feat(python): make rdma get/set available in python glide-sync Oct 26, 2026
@anitarua
anitarua force-pushed the feat/rdma-4-python-sync branch from c86753c to 6fbb2bf Compare October 26, 2026 20:56
@anitarua
anitarua force-pushed the feat/rdma-3-ffi-integration branch from 3d44ae6 to 7b5b711 Compare October 27, 2026 21:04
@anitarua
anitarua force-pushed the feat/rdma-4-python-sync branch from 6fbb2bf to a911957 Compare October 27, 2026 23:08
@anitarua
anitarua requested a review from jeremyprime October 27, 2026 23:13
@jeremyprime

Copy link
Copy Markdown

LGTM, I think this is ready to opened against upstream once valkey-io#7412 (and #1) is merged. Then CI will run and we'll see if any comments from the review bots.

@jamesx-improving jamesx-improving left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the quick rework; the cancel/close path and both of jeremyprime's leaks look right now. One packaging blocker left, inline.

Comment thread python/glide-sync/setup.py Resolved
@anitarua
anitarua force-pushed the feat/rdma-3-ffi-integration branch from 7b5b711 to fc9bafc Compare October 28, 2026 21:50
…-io#7454)

* fix(python): stop async client hang after pool borrow/release

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* fix(ffi): gate glide_allocate_client_id behind pool-support

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* fix(python): make regression test id-assertion xdist-safe

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* fix(python): make regression test xdist-safe and consistency-clean

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

* fix(ffi,python): ungate glide_allocate_client_id; trim comments

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

---------

Signed-off-by: Jeremy Parr-Pearson <jeremy.parr-pearson@improving.com>

@jamesx-improving jamesx-improving left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, thanks for the fixes. It now conflicts with the rebased feat/rdma-3-ffi-integration (valkey-io#7458); replaying it onto e0fe021, the first conflict is CHANGELOG.md.

…7457)

glide_pool_metrics wrote three counts through out-pointers and returned
an int32 code, -1 for both an unknown pool and a contended lock, writing
nothing. The counts and the verdict on whether they were read travelled
separately, so a binding could take zero-filled buffers as the pool's
state (valkey-io#7129).

The function now returns a repr(C) PoolMetrics { status, idle, active,
total } by value, so no caller holds counts without the status. When a
read is declined is unchanged (try_lock); valkey-io#7130 changes that. Go and
Python read the struct and report the same numbers as before, zeros on
a non-Read status. Java and Node keep their own copies.

Refs valkey-io#7129

Signed-off-by: Neil Derraugh <neil.derraugh@improving.com>
KevinFriedland88 and others added 11 commits October 29, 2026 14:26
…rseding refresh (valkey-io#7435)

When routing a key-based command to a specific node, if the connection is missing because a refresh task is currently in progress, SpecificNode routing previously waited on a single reconnect notifier once. If another refresh was triggered or superseded the original refresh task, the route could stop waiting prematurely while the refresh was still ongoing.

This change:
1. Loops while a refresh task remains registered for the target route.
2. Acquires the owned notification handle under the same read lock as the connection lookup, preventing missed wakeups between lock drop and await.
3. Adds unit tests verifying that SpecificNode routing continues waiting across in-progress and superseded refresh tasks.

Fixes valkey-io#7434

Signed-off-by: Kevin Friedland <347626243+KevinFriedland88@users.noreply.github.com>
Signed-off-by: James Xin <james.xin@improving.com>
Co-authored-by: Kevin Friedland <347626243+KevinFriedland88@users.noreply.github.com>
feat(ffi): expose RDMA get/set through the FFI (valkey-io#7458)

Make glide-rdma available to the FFI layer behind an opt-in `rdma` Cargo
feature, so the Python glide-sync client can transfer large values with the
valkey-large-object module over RDMA. This serves KV-cache adapters such as
LMCache and vLLM.

- New C API in ffi/src/rdma_ffi.rs: register_rdma_region, rdma_get,
  rdma_set, rdma_close_regions and free_rdma_region, plus memory-hold
  helpers that tell released memory apart from parked or leaked memory.
- glide-core and glide-rdma gain register-by-address
  (register_rdma_region_raw / register_raw). This lets memory a C caller
  owns be registered without forming a Rust reference to it.
- close_client revokes the client's RDMA regions. Pools reject an RDMA
  configuration.
- CI runs the rdma feature tests, and glide-sync vendors glide-rdma.

Limitations: no RDMA in client pools yet, and sync client only.

Related: valkey-io/valkey#4743

---------

Signed-off-by: Anita Ruangrotsakun <anita@momentohq.com>
Co-authored-by: valkey-review-bot[bot] <282604435+valkey-review-bot[bot]@users.noreply.github.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
…s in use

Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
…close_client

Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
Signed-off-by: anitarua <anita@momentohq.com>
@anitarua
anitarua force-pushed the feat/rdma-4-python-sync branch from 135286f to 02bb313 Compare October 29, 2026 23:14
@anitarua

Copy link
Copy Markdown
Owner Author

closing in favor of valkey-io#7464

@anitarua anitarua closed this Oct 29, 2026
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.

5 participants