Skip to content

memcached: read the healthy servers' replies when mget partly fails - #110

Merged
antirotor merged 2 commits into
enhancement/featuriing-memcachedfrom
fix/memcached-mget-partial-failure
Nov 5, 2026
Merged

antirotor merged 2 commits into
enhancement/featuriing-memcachedfrom
fix/memcached-mget-partial-failure

Conversation

@antirotor

Copy link
Copy Markdown
Member

Description

getMany now reads the healthy servers' replies when memcached_mget reports a partial failure.

Follow-up to #105, based on its head (d7b6e17). Only the last commit, a8fb02b, is new. Merge this after #105. Until #105 merges, the diff here also shows #104's and #105's commits.

Changelog

memcached_mget returns MEMCACHED_SOME_ERRORS when one server failed and the others were sent the request. getMany treated that as a complete failure and returned, which would send the healthy servers' keys to AYON. It now logs the failure and continues reading.

Linked issues/branches

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Additional info

This is a defensive fix: the failure was not reproduced. Four scenarios with two servers and one dying after startup (before the first read, after libmemcached noticed the failure, after its retry timeout, and with requests larger than its write buffer) never produced MEMCACHED_SOME_ERRORS with libmemcached-awesome 1.1.0. In each one the healthy server's hits were already kept, and only the dead server's keys went to AYON. The change only affects that one return code, so it does not change those paths.

test_one_dead_server_keeps_hits_from_the_others covers the last of those scenarios, and passes with and without this change. It will be added to #107 with the other new scenarios.

Whole stack, real local merge (#106 merged with #108, this PR and the confirmed-miss follow-up): 123 passed and 2 expected failures, the site-roots case #106 leaves open.

memcached_mget returns MEMCACHED_SOME_ERRORS when one server failed and the
others were sent the request. getMany treated that as a complete failure, so it
never read those replies and sent the healthy servers' keys to AYON.
@antirotor antirotor added the type: bug Something isn't working label Nov 5, 2026
@antirotor antirotor self-assigned this Nov 5, 2026
@antirotor
antirotor requested a balanced review from Copilot November 5, 2026 15:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the change preserving available memcached replies after partial lookup failures.

No open issues 🎉

What changed in this PR

This follow-up to #105 preserves healthy memcached servers’ replies when a batched lookup partially fails, avoiding unnecessary AYON lookups for those cached keys.

Changes:

  • Continue reading results after logging MEMCACHED_SOME_ERRORS.
  • Keep the existing early return for other failure codes.
File Description
src/​AyonUsdResolver/​cache/​memcachedHandler.cpp Allows getMany to read available replies after a partial memcached_mget failure.

Review effort: Balanced

@antirotor
antirotor merged commit 94adce5 into enhancement/featuriing-memcached Nov 5, 2026
1 check passed
@antirotor
antirotor deleted the fix/memcached-mget-partial-failure branch November 5, 2026 15:05
antirotor added a commit that referenced this pull request Nov 5, 2026
Add the scenarios that fail on builds without #108, #109 and #110, now
that those are merged:

- miss markers: trust window, ClearCache and DeleteFromCache ending it,
  an invalidation during a read, a path stored during the lookup
- malformed AYON answers write no marker; an empty answer still does
- dangling references are read once, and their open time
- one dead server keeps the hits from the others

The proxy can now hold the reads of one key, and the probe can open a
stage in the background, to keep the races open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants