8000 feat: improve GetMulti method resilience and performance by flyhope · Pull Request #193 · bradfitz/gomemcache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: improve GetMulti method resilience and performance #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flyhope
Copy link
@flyhope flyhope commented Jun 20, 2025
  • Skip failed servers instead of returning early when PickServer fails
  • Pre-allocate result map with expected capacity to avoid dynamic resizing
  • Ensure partial results are returned even when some memcache servers are unavailable

This change improves fault tolerance by allowing GetMulti to continue processing keys from healthy servers when some servers are down, while also optimizing memory allocation performance.

Fixes issue where GetMulti would fail entirely if any single server was unreachable, now gracefully handles server failures and returns available data from functioning servers.

- Skip failed servers instead of returning early when PickServer fails
- Pre-allocate result map with expected capacity to avoid dynamic resizing
- Ensure partial results are returned even when some memcache servers are unavailable

This change improves fault tolerance by allowing GetMulti to continue
processing keys from healthy servers when some servers are down, while
also optimizing memory allocation performance.

Fixes issue where GetMulti would fail entirely if any single server
was unreachable, now gracefully handles server failures and returns
available data from functioning servers.
@JontyLee
Copy link

This change indeed improves the efficiency of batch cache data retrieval and provides better fault tolerance.

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.

2 participants
0