Skip to content

feat(approx-prefix): share pod block hashes across EPP replicas - #5

Open
Lucas-Fernandes-Martins wants to merge 2 commits into
lfm/cross-replica-clean-redis-testfrom
lfm/multi-epp-kv-cache-sync
Open

feat(approx-prefix): share pod block hashes across EPP replicas#5
Lucas-Fernandes-Martins wants to merge 2 commits into
lfm/cross-replica-clean-redis-testfrom
lfm/multi-epp-kv-cache-sync

Conversation

@Lucas-Fernandes-Martins

Copy link
Copy Markdown

An all-active EPP pool splits prefix affinity N ways. Each replica only indexes the requests it handled itself, so the same prefix routes to a different pod depending on which replica Envoy picked, and the pods duplicate each other's cache instead of specialising.

Implement CrossReplicaContributor on the approx producer so each replica publishes its per-pod block hashes and reads back the union. Produce takes whichever match is longer -- local or peer -- so a peer's view can only promote pods the local index would score as cold, never demote one.

Off by default behind syncCrossReplicaState. crossReplicaBlocksPerPod can cap how many MRU hashes each pod publishes; 0 (the default) publishes the whole LRU, which is up to LRUCapacityPerServer entries per pod per sync.

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Release note (write NONE if no user-facing change):

NONE

An all-active EPP pool splits prefix affinity N ways. Each replica only
indexes the requests it handled itself, so the same prefix routes to a
different pod depending on which replica Envoy picked, and the pods
duplicate each other's cache instead of specialising.

Implement CrossReplicaContributor on the approx producer so each replica
publishes its per-pod block hashes and reads back the union. Produce takes
whichever match is longer -- local or peer -- so a peer's view can only
promote pods the local index would score as cold, never demote one.

Off by default behind syncCrossReplicaState. crossReplicaBlocksPerPod can
cap how many MRU hashes each pod publishes; 0 (the default) publishes the
whole LRU, which is up to LRUCapacityPerServer entries per pod per sync.
newCrossReplicaPublisher discovers contributors by walking the datalayer's
extractor map, so implementing CrossReplicaContributor is not sufficient on
its own: a plugin that never registers as an extractor is never asked for
its state. The approx producer, unlike inflight-load, was not a Registrant,
so CrossReplicaState() would have been dead code at runtime.

Register as an EndpointExtractor when sync is enabled. Extract itself is a
no-op -- pod removal is still handled by CleanUpInactivePods -- and
registration is skipped when sync is off so the default path does not gain
an endpoint-notification-source it has no use for.
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.

1 participant