Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component-specific data storage #229

Closed
alnikola opened this issue Jun 5, 2020 · 5 comments · Fixed by #600
Closed

Component-specific data storage #229

alnikola opened this issue Jun 5, 2020 · 5 comments · Fixed by #600
Assignees
Labels
Type: Idea This issue is a high-level idea for discussion.

Comments

@alnikola
Copy link
Contributor

alnikola commented Jun 5, 2020

There is a need for the storage where different proxy components can store data specific to their internal logic.

At the very least this storage must provide the following capabilities:

  1. Storing mutable and immutable data
  2. Fast and thread safe retrieval of an entity by key efficiently operating in a highly concurrent environment
  3. Thread safe operations to add, update and delete data entities

Optionally it should also provide:

  1. Persistent storage preserving data between proxy process restarts
  2. Data changes notifications

Examples of the storage use cases:

  1. Destination affinity key lookup table for session affinity feature
  2. Load balancing counters

See also #87

@alnikola alnikola added the Type: Idea This issue is a high-level idea for discussion. label Jun 5, 2020
@samsp-msft samsp-msft added this to the 1.0.0 milestone Jun 23, 2020
@Tratcher
Copy link
Member

Tratcher commented Jul 7, 2020

Design review: ClusterInfo.DynamicState is the current location for this class of data, but it needs to be extensible.

This property can be replaced with a ConcurrentDictionary to store arbitrary state. If change notification is needed, an implementer may choose to store a Signal in the dictionary.

@Tratcher
Copy link
Member

We ended up using ConditionalWeakTable for this in TransportFailureRateHealthPolicy. It seems like a good compromise for adding state to entities you don't own.

@alnikola
Copy link
Contributor Author

@Tratcher Should we close it then if there is no actual work left?

@Tratcher
Copy link
Member

We should check what other state should be moved to this pattern first:

@MihaZupan MihaZupan self-assigned this Nov 30, 2020
@samsp-msft
Copy link
Contributor

We need to be able to associate the custom metadata with:

  • Routes
  • Clusters
  • Individual destinations

For another example, see #587 where the need is to be able to associate metadata on the routes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Idea This issue is a high-level idea for discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants