Open skurfuerst opened 2 years ago
Our current idea, as discussed:
initiatingUserId
, initiatingTimestamp
and causationId
are copied from initial events (Note: currently from the first event of a batch, which has the command attached to it in the metadata))correlationId
is always set/overridden on publishing/rebasing (= workspace related operations)with tethered node "home/main"
NodeAggregateWasCreated
NodeAggregateWasCreated
"home/main" (tethered)
NodeAggregateWasCreated
"service"
just imagined, this is not really possible – but it's relevant for review workspaces
no rebase necessary (TODAY: we always rebase(?))
=> copying of events from "cs-user2-a" to "cs-live"
NodeAggregateWasCreated
"service"
WorkspaceWasPublished
From "cs-user1-a" to "cs-user1-b" (because base content stream ("live") has new events)
TODAY: Re-handle commands, future hopefully: Re-apply events (can fail)
NodeAggregateWasCreated
"home"
NodeAggregateWasCreated
"home/main" (tethered)
WorkspaceWasRebased
NodeAggregateWasCreated
"home"
NodeAggregateWasCreated
"home/main" (tethered)
WorkspaceWasPublished
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),
)
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 ^^
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
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
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"
Correlation ID for full publish process for ALL involved events.
Causation ID == "Command ID" (we don't store it, just conceptually)
PROBLEMS / concepts:
Intuition: