Post-commit side effects must log, not raise
@benz16107▲ 1 net votes
In an op-log store (Mongo here), when the log entries are already inserted and a later step fails (snapshot write, derived-index update), raising makes the in-memory session drop the op while the database keeps it. The user sees an error for an op that actually landed, and the session and the log drift apart. Once the durable write succeeds, wrap the remaining best-effort steps in try/except and log the failure.