-
Notifications
You must be signed in to change notification settings - Fork 232
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
docs: DR for clustered data-plane #4522
Merged
ndr-brt
merged 3 commits into
eclipse-edc:main
from
Think-iT-Labs:clustered-data-plane-DR
Oct 4, 2024
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
docs/developer/decision-records/2024-10-02-clustered-data-plane/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Clustered data-plane | ||
|
||
## Decision | ||
|
||
We will make the data-plane being able to run in a clustered environment. | ||
|
||
## Rationale | ||
|
||
Currently, data-plane cannot run effectively in a clustered environment because: | ||
- there's no way to identify a specific replica that is running a data flow and "terminate/suspend" it | ||
- there's no way to re-start a data flow that was interrupted because the replica crashed | ||
|
||
## Approach | ||
|
||
We will provide this feature through the `DataPlaneStore` persistence layer. | ||
A `runtimeId` will be added in the `DataFlow`, and it will be set when it gets started with the replica's `runtimeId`. | ||
There will be a configured duration `flowLease` (that can be in milliseconds, seconds at most). | ||
|
||
### Identify specific replica to suspend/terminate | ||
|
||
The now synchronous `suspend`/`terminate` will become asynchronous by putting the `DataFlow` in a `-ING` state like: | ||
- `SUSPENDING` | ||
- `TERMINATING` | ||
|
||
For termination (the same logic will be duplicated for suspension), in the `DataPlaneManager` state machine there will be | ||
two new `Processor` registered: | ||
- one filters by `TERMINATING` state and `runtimeId`: it will stop the data flow and transition it to `TERMINATED` | ||
- one filters by `TERMINATING` and by `updatedAt` passed by at least 2/3 times `flowLease`: it will transition the data flow to | ||
`TERMINATED` (as cleanup for dangling data flows). | ||
|
||
Note: once the "termination" message is sent from the control-plane to the data-plane and the ACK received, the control-plane | ||
will consider the `DataFlow` as terminated, and it will continue evaluating the termination logic on the `TransferProcess` | ||
(send protocol message, transition to `TERMINATED`). | ||
We consider this acceptable because `DataFlow` termination is generally a cleanup operation that shouldn't take too much time. | ||
|
||
### Re-start interrupted data flow | ||
|
||
Please consider `flowLease` as a configured time duration (milliseconds, seconds at most). | ||
|
||
A running data flow will need to update the `updatedAt` field every `flowLease` | ||
In the `DataPlaneManager` state machine, fetches items in `STARTED` with `runtimeId` different from the replica one, | ||
that have `updatedAt` past by at least 2/3 times `flowLease`. | ||
These data-flows can then be started again | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These will be propagated back to the control plane, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are releated to
DataFlow
, becauseSUSPENDING
andTERMINATING
in the control-plane have different meaning.only when the
DataFlow
would been correctlySUSPENDED
orTERMINATED
the control-plane will be advertised and it would transition the transfer from theSUSPENDING
/TERMINATING
state toSUSPENDED
/TERMINATED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I meant the transition to Dataflow terminated, now that the operation is async. There's two ways to approach this:
Appraoch 2 is a lot easier and straightforward without much downside. It does place the burden on the data plane to handle the terminate message correctly or perform some form of cleanup if it fails but that I think is acceptable.
What do you think? Perhaps this should be documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think 2 will be enough because termination of data flow it's just a cleanup operation, generally speaking it should be quick to complete. I will add some details to the DR