Skip to content

multi-get#16

Open
bisho wants to merge 1 commit into
mainfrom
03-16-multi-get
Open

multi-get#16
bisho wants to merge 1 commit into
mainfrom
03-16-multi-get

Conversation

@bisho
Copy link
Copy Markdown
Member

@bisho bisho commented Mar 17, 2026

Motivation / Description

This pull request adds batch operation support to the memcache socket implementation by introducing a meta_multiget method that can efficiently retrieve multiple keys in a single operation.

Changes introduced

  • Added meta_multiget method to MemcacheSocket class that accepts a list of keys and optional request flags
  • The method builds all commands into a single buffer, sends them in one syscall, and receives all responses in a tight Rust loop with GIL released during socket I/O
  • Returns responses in the same order as the input keys, maintaining consistency with individual get operations
  • Removed unused get_value method from the Rust implementation
  • Added comprehensive test coverage for the new batch functionality including edge cases like empty keys, mixed hits/misses, large values, small buffers, and various flag combinations
  • Updated type stubs to include the new meta_multiget method signature and documentation

@bisho bisho marked this pull request as ready for review March 17, 2026 08:56
@ethervoid
Copy link
Copy Markdown

@claude review this pr

@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch from 9f5a863 to f9ac819 Compare March 24, 2026 09:16
@bisho bisho force-pushed the 03-16-multi-get branch from 044cd79 to 2081924 Compare March 24, 2026 09:16
@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch 2 times, most recently from f714a41 to b6c831e Compare March 24, 2026 17:11
@bisho bisho force-pushed the 03-16-multi-get branch 2 times, most recently from c944e91 to f66d7e5 Compare March 24, 2026 18:07
@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch from b6c831e to 09802be Compare March 24, 2026 18:07
@bisho bisho requested a review from a team March 25, 2026 08:28
@zenitraM zenitraM requested a review from Copilot March 25, 2026 08:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds batch meta-get support to the MemcacheSocket implementation via a new meta_multiget method, enabling multiple mg commands to be issued and parsed within a single Rust call (with GIL released during socket I/O).

Changes:

  • Added MemcacheSocket.meta_multiget in Rust to pipeline multiple mg requests and collect responses in input order.
  • Added a new Python test suite for meta_multiget, including ordering, buffering, mixed hit/miss, and NOOP-drain scenarios.
  • Updated the .pyi type stubs and documentation to expose meta_multiget.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/memcache_socket.rs Implements meta_multiget with batched send + tight response loop under py.detach.
tests/test_memcache_socket.py Adds batch-oriented tests for meta_multiget covering edge cases and socket state interactions.
meta_memcache_socket.pyi Adds the meta_multiget stub and docstring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_memcache_socket.py
Comment thread tests/test_memcache_socket.py Outdated
Comment thread src/memcache_socket.rs Outdated
Comment thread meta_memcache_socket.pyi Outdated
Comment thread tests/test_memcache_socket.py Outdated
Comment thread tests/test_memcache_socket.py
@bisho bisho force-pushed the 03-16-multi-get branch from f66d7e5 to 9cb2fb7 Compare March 25, 2026 09:28
@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch from 09802be to c5237c1 Compare March 25, 2026 09:28
@bisho bisho force-pushed the 03-16-multi-get branch from 9cb2fb7 to 2ba74cc Compare March 25, 2026 14:12
@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch from c5237c1 to e46fe95 Compare March 25, 2026 14:18
@bisho bisho force-pushed the 03-16-multi-get branch 2 times, most recently from b4355f6 to f582779 Compare March 25, 2026 14:21
@bisho bisho force-pushed the 03-12-move_key_encoding_to_rust branch from e46fe95 to 3cc05e3 Compare March 25, 2026 14:21
@bisho bisho changed the base branch from 03-12-move_key_encoding_to_rust to graphite-base/16 March 25, 2026 14:26
@bisho bisho force-pushed the graphite-base/16 branch from 3cc05e3 to c103ed4 Compare March 25, 2026 14:27
@bisho bisho force-pushed the 03-16-multi-get branch from f582779 to 738c0b9 Compare March 25, 2026 14:27
@graphite-app graphite-app Bot changed the base branch from graphite-base/16 to main March 25, 2026 14:27
@bisho bisho force-pushed the 03-16-multi-get branch 2 times, most recently from ffe2649 to 5ef1f07 Compare March 26, 2026 12:47
@bisho bisho force-pushed the 03-16-multi-get branch from 5ef1f07 to acf1c63 Compare March 26, 2026 13:03
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.

3 participants