Skip to content

Commit

Permalink
docs: PolicyMonitor DR (eclipse-edc#3441)
Browse files Browse the repository at this point in the history
* docs: PolicyMonitor DR

* PR remarks
  • Loading branch information
ndr-brt authored and ndkrimbacher committed Oct 4, 2023
1 parent 254ee3b commit ff93d51
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generic Properties

## Decision

A `PolicyMonitor` extension component will be implemented.

## Rationale

Some transfer types, such as streaming never reach the `COMPLETED` state, so they need to be terminated whenever the
`Policy` on which the participants agreed is not valid anymore.

## Approach

This component will be implemented using the same model as the state machine we're using for `TransferProcess`:

- The ingestion will be done with a listener on the `TransferProcessStarted` event, that will add an entry to a `PolicyMonitorStore`.
- The state machine then will continuously fetch the oldest entries leasing them, check the related policy.
- If the check fails the TP will get completed through a service call (that could be either embedded in the control-plane
or remote through a rest call) and the entry will be removed from the `PolicyMonitorStore`.
- otherwise the lease will be broken and the policy be verified again in the next run.

With "leasing" we mean that the entity will be reserved by a connector instance that will be the only one allowed to modify it
until the lease gets broken, and this can happen by updating it or after a certain amount of time.

This mechanism will permit to scale the process to multiple instances.

The `PolicyMonitor` will be deployable embedded in the control-plane or separately in a standalone runtime.
The `PolicyMonitorStore` will have a in-memory implementation for testing scenarios and a sql (postgres) one.
1 change: 1 addition & 0 deletions docs/developer/decision-records/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
- [2023-06-30 State Machine guards](2023-07-20-state-machine-guards)
- [2023-08-01 Default datasource](2023-08-01-default-datasource)
- [2023-08-07 Generic properties](./2023-08-07-generic-properties)
- [2023-09-07 Policy Monitor](./2023-09-07-policy-monitor)

0 comments on commit ff93d51

Please sign in to comment.