Lets say I'm implementing Domain Driven Design using C# and Entity Framework.
My code is structured such that each aggregate has its own dbcontext in EF to respect the principle of transactional boundaries around my aggregates.
Aggregate 1, InventoryAggregate, and Aggregate 2, OrderAggregate, are being updated by some business process, AddItemToOrder.
After OrderAggregate adds the item, it fires a domain event, ItemAddedToOrder that is listened to by InventoryAggregate, who then performs some business process, SubtractQuantityFromInventory.
InventoryAggregate fails to subtract the inventory and it fires a domain event, NotEnoughInventory, listened to by OrderAggregate.
OrderAggregate then attempts to remove the item from the order but fails.
Now there is an item in the order that should not be because we don't actually have enough inventory to sell the item.
How should this be handled?