ROX-32848: Ack-based retry for VM#20105
Closed
vikin91 wants to merge 2 commits intopiotr/ROX-32316-vm-relay-ack-flowfrom
Closed
ROX-32848: Ack-based retry for VM#20105vikin91 wants to merge 2 commits intopiotr/ROX-32316-vm-relay-ack-flowfrom
vikin91 wants to merge 2 commits intopiotr/ROX-32316-vm-relay-ack-flowfrom
Conversation
Introduce reportPayloadCache with LRU eviction and TTL, wired into the relay for caching VM index report payloads. On UMH retry, the relay resends the cached payload instead of waiting for a new VM report. This is the second half of the split from the ack-flow branch. Made-with: Cursor
Contributor
Author
|
This change is part of the following stack: Change managed by git-spice. |
11 tasks
|
Skipping CI for Draft Pull Request. |
Contributor
Author
|
Closed automatically by renaming branch. New PR: #20107 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a bounded, TTL-aware payload cache to the VM relay so that UMH-driven retransmissions can resend the last known report without waiting for the VM agent to push a new one.
What
reportPayloadCache— LRU cache (byupdatedAt) with configurable max slots and TTL. Backed bycontainer/list+ map for O(1) insert/lookup/evict. Uses its own mutex, independent of the metadata cache.EqualVT).payloadCacheTTL / 2interval).cache_slots_used,cache_slots_capacity,cache_residency_seconds,cache_lifetime_seconds,cache_lookups_total{hit|miss}.ROX_VM_INDEX_REPORT_RELAY_CACHE_SLOTS(default 100),ROX_VM_INDEX_REPORT_RELAY_CACHE_TTL(default 4h).Why
Without the cache, a UMH retry for a report whose initial send failed (or was not ACKed in time) has no payload to resend. The relay would have to wait for the next VM agent push, which may take minutes. Caching the last payload per VSOCK ID closes this gap.
User-facing documentation
Testing and quality
###ated testing
How I validated my change
Ran the full compliance test suite and the relay package tests locally:
go test ./compliance/... ./compliance/virtualmachines/relay/... -count=1 -timeout 120sAll 25 packages pass (including 507 new lines of
report_payload_cache_test.gocovering LRU eviction order, TTL expiry, bounded sweep budget, capacity=0 disabled mode,Getnot promoting recency,Removeduration reporting, and sweep-then-upsert interaction; plus 395 new/modified lines inrelay_test.gocovering cache-hit resend, cache-miss metric, cache-disabled mode, ACK removes payload entry, and expired-payload-resends-until-sweep-evicts).AI disclosure
The initial implementation and tests were generated with AI assistance. All code was reviewed, corrected, and validated by the author.