You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tksugimoto
changed the title
Entity processes the command in the presence of uncommitted events
A new event is created even though all past events have not been applied
Feb 22, 2022
TODO: Translate to English
期待する振る舞い
過去に発行したイベントを全て適用した状態で新たな決定(イベントの発行)を行うことが期待されるため、コミットされていないイベントがある時は Entity はコマンドを処理しない。
問題(期待する振る舞いとのギャップ)
未コミットのイベントがある状態でも Entity がコマンドを処理し、過去に発行したイベントが全て適用されていない状態で新たなイベントを発行してしまうケースがある。
イベントをレプリケーション中に Leader 側の RaftActor がクラッシュすると、新しい Leader に属する Entity が未コミットのイベントが存在する状態で
ProcessCommand
を処理してしまう場合がある。例) (TODO: use mermaid )
![replicationsucceeded2 drawio](https://user-images.githubusercontent.com/13145001/154929592-653f0c03-16cc-47e9-ac02-cab399b5e161.png)
発生条件
次の 3 つの条件を全て満たす場合に発生します。
ProcessCommand
が Entity に届くProcessCommand
が完了した後にイベントのレプリケーションが完了するThe text was updated successfully, but these errors were encountered: