Shared Nexus endpoint lookup cache#10204
Open
stephanos wants to merge 1 commit into
Open
Conversation
S15
previously approved these changes
May 8, 2026
ab4d940 to
65c65a9
Compare
5 tasks
975897c to
8ef607e
Compare
b16743a to
00f7ea4
Compare
00f7ea4 to
818e3e6
Compare
stephanos
commented
May 13, 2026
| } | ||
| return true | ||
| }, 10*time.Second, 100*time.Millisecond, "endpoint should become visible") | ||
| } |
6535d73 to
b704a69
Compare
stephanos
commented
May 13, 2026
| } | ||
| } | ||
|
|
||
| func (r *EndpointRegistryImpl) refreshEndpointsLoop(ctx context.Context, dataReady *dataReady) error { |
Contributor
Author
There was a problem hiding this comment.
Yes, it's redundant locally now but I opted to leave this in-place when in-process to not diverge the behavior from prod any more.
bced3f9 to
c1d9baf
Compare
b94441a to
d169a8b
Compare
stephanos
commented
May 13, 2026
| endpointsByName map[string]*persistencespb.NexusEndpointEntry | ||
| tableVersionChanged chan struct{} | ||
| sync.RWMutex // protects endpointEntries | ||
| endpointEntries []*persistencespb.NexusEndpointEntry // sorted by ID to support pagination during ListNexusEndpoints |
Contributor
Author
There was a problem hiding this comment.
endpointEntries could also live in the cache, but then history would need to allocate this needlessly.
e28b958 to
2932125
Compare
stephanos
commented
May 13, 2026
| } | ||
|
|
||
| // reset cached view since we will be paging from the start | ||
| m.resetCacheStateLocked() |
Contributor
Author
There was a problem hiding this comment.
Not clearing the cache here as it would also clear the history cache; the view on the matching side will still be consistent as this happens under a lock
2932125 to
bf69331
Compare
bf69331 to
db55bb8
Compare
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.
What changed?
Shared cache for Nexus endpoint name lookups when history/matching run in same process.
Why?
During testing - such as functional server tests or SDK tests against the CLI - the Nexus endpoint is not always immediately available after creation. This creates friction as it requires extra retries and causes flakiness if not guarded against. This change eliminates that need.
How did you test it?
Risk
Significantly more complex change than #10208