Cache participant context configuration across transactions

Aperta
#6,182 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java

Direzione di ricerca

Start with ParticipantContextConfigImpl and the config service that writes configurations; review the existing per-transaction cache and the CEL expressions snapshot pattern mentioned in the issue. Check how reads, saves, and deletes interact with transactions and encrypted stored values. Done means a bounded, short-TTL cross-request cache reduces repeated lookups, local writes evict entries, and reads within a transaction remain consistent.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

feature_request triage

Feature Request

Cache participant context configuration across transactions, so that reading a participant's configuration doesn't cost a database query in every transaction.

Which Areas Would Be Affected?

participant-context-config-core: ParticipantContextConfigImpl, and the config service that writes configurations.

Why Is the Feature Desired?

ParticipantContextConfigImpl.fetchConfig caches a participant's configuration per transaction (#6074): a
ThreadLocal map, cleared by a transaction synchronization when the transaction ends. Within one transaction the configuration is loaded once. A flow, however, spans dozens of transactions, and config reads also happen outside any transaction, where each read opens its own:

  • the steps of the state machine workers;
  • the incoming DSP messages on both sides (DID and STS settings during token validation and presentation requests);
  • dispatching messages (STS token creation);
  • Management API calls.

Measured in a load test (single runtime hosting provider and consumers, negotiation + transfer, 40 flows/s):

Per completed flow
DB transactions (commits) ~114–122
of which participant-config lookups ~59

That is, about half of all transactions only read configuration. A catalog request costs 10–15 lookups (consumer and provider side in one runtime). Each lookup is a short transaction: connection borrow and validation, SELECT by primary key, COMMIT.

Configuration changes rarely (onboarding, rotations, PATCH through the API), so these reads are almost always
redundant.

Solution Proposal

  • A cross-request cache in ParticipantContextConfigImpl, keyed by participant context id, with a short TTL
    (e.g. edc.participant.context.config.cache.ttl.ms, a few seconds; 0 disables it). This follows the CEL
    expressions snapshot (edc.policy.cel.expressions.cache.ttl.ms).
  • Invalidate on local writes: saving or deleting a configuration through this runtime evicts its entry
    immediately. Other replicas see the change within the TTL.
  • Bounded size (LRU), since a runtime may host many participants.
  • Keep the per-transaction cache, or let the TTL cache replace it, as long as reads within one transaction stay consistent.
  • Private (encrypted) entries: cache the stored form only, and decrypt on read as today.
Lingua principale
Java
Stelle
429
Fork
302
Merge medio
10h 46m
PR unite (30g)
75

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-edc/Connector

Tutte le issue di eclipse-edc/Connector

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.