neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

9.0: Correctly set Correlation and Causation IDs #3887

Open skurfuerst opened 2 years ago

skurfuerst commented 2 years ago

Causation ID == "Command ID" (we don't store it, just conceptually)


PROBLEMS / concepts:

Intuition:

bwaidelich commented 2 years ago

Our current idea, as discussed:

Example

Authenticated User "user1"

Create Node "home"

with tethered node "home/main"

Authenticated User "user2"

Create node "service"

Authenticated User "user3"

Publishing of "user2" changes

just imagined, this is not really possible – but it's relevant for review workspaces

Authenticated User "user1"

Rebasing

Publishing of "user1" changes to "live"

bwaidelich commented 10 months ago

After an issue @ahaeslich had today with lots of ContentStreamWasForked events without corresponding Workspace events (see Slack discussion) this missing feature gets more critical and made me think: The causationId does not have to be a UUID but it could contain some pre/suffix explaining the corresponding interaction, for example: rebaseWorkspace-62a2c5d06b834252b686e00ce6aa2548.

If it turns out to be too much work to introduce the complete causation/correlation handling for now, we should at least add some property to the ForkContentStream command (and the corresponding event), e.g.:

ForkContentStream::create(
    $rebasedContentStream,
    $baseWorkspace->currentContentStreamId,
    sprintf('Rebase workspace "%s" (content stream "%s"), $command->workspaceName->value, $command->contentStreamId->value),
)
mhsdesign commented 10 months ago

Ah this issue also made it to our list of big questions. But i dont really understand what is being discussed here, and it troubles me as this topic is marked critical ^^

bwaidelich commented 10 months ago

it troubles me as this topic is marked critical

Don't worry. This is critical for debugging the event log, but at least the last suggestion should be very easy to add and without any breaking changes

bwaidelich commented 10 months ago

If it turns out to be too much work to introduce the complete causation/correlation handling for now, we should at least add some property to the ForkContentStream command

As discussed, I created a separate high-prio issue (#4758) for that part and remove this one from the priority list

bwaidelich commented 4 months ago

Reminder: We should also set some kind of "originalEventId" metadata to events published to other content streams in order to correlate those.

This will allow us to detect "merges" rather than new events, i.e. instead of

%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'Live', 'parallelCommits': false, 'rotateCommitLabel': true}} }%%
      gitGraph LR:
        branch "content stream A"
        commit id:"Node A created"
        commit id:"Node A properties set"
        commit id:"content stream A closed"
        branch "content stream B"
        commit id:"Content A stream forked'"
        commit id:"Node A created'"
        commit id:"Node A properties set'"
        commit id: "content stream B closed"
        branch "content stream C"
        commit id:"content stream B forked"
        commit id:"Node A created''"
        commit id:"Node A properties set''"
        checkout Live
        commit id:"Node A created'''"
        commit id:"Node A properties set'''"
        checkout "content stream C"
        commit id:"Content stream C removed"
        checkout "content stream B"
        commit id:"content stream B removed"

we could produce sth like

%%{init: { 'logLevel': 'debug', 'theme': 'base', 'gitGraph': {'showBranches': true, 'showCommitLabel':true,'mainBranchName': 'Live', 'parallelCommits': false, 'rotateCommitLabel': true}} }%%
      gitGraph LR:
        checkout Live
        commit id:"created"
        branch "content stream A"
        commit id:"Node A created"
        commit id:"Node A properties set"
        commit id:"content stream A closed"
        branch "content stream B"
        commit id:"content stream A forked'"
        merge "content stream A"
        checkout "content stream B"
        commit id: "content stream B closed"
        branch "content stream C"
        commit id:"content stream B forked"
        merge "content stream B"
        checkout Live
        merge "content stream C"
        checkout "content stream C"
        commit id:"content stream C removed"
        checkout "content stream B"
        commit id:"content stream B removed"