-
Notifications
You must be signed in to change notification settings - Fork 107
Labels
area/networkingRelated to networking I/ORelated to networking I/Oarea/xdsRelated to Envoy xDSRelated to Envoy xDSkind/featureNew feature or requestNew feature or request
Description
Add support for Corrosion subscriptions.
Basically a subscription is a SQL query coupled with a tokio::sync::mpsc::Receiver that will receive any changes that occur in the database that match the SQL query. There is then additional logic layered on top of this mechanism to handle, essentially, 2 other scenarios.
- Multiple subscribers - Since the subscriber is an mpsc::Receiver there can only be a single subscriber, so Corrosion layers an additional subscriber cache on top so that it goes from mpsc -> broadcast -> mpsc
- Catchup - When a new subscriber, or a subscriptions drops then resubscribes from a known change id, the subscription attempts to be caught up to head, while changes can still be occuring in the db, in which case they are buffered before being applied to the subscriber.
Both of these use cases are core to how proxies will subscribe to changes, but the Corrosion code was too tightly coupled for my liking so some pieces have been copied into quilkin and modified for our use so that the subscription logic is completely separate from any I/O so that it can be easily tested separately.
Metadata
Metadata
Assignees
Labels
area/networkingRelated to networking I/ORelated to networking I/Oarea/xdsRelated to Envoy xDSRelated to Envoy xDSkind/featureNew feature or requestNew feature or request