Problem: Multiple parties reporting completion simultaneously caused lost updates because each transaction would read the full session, modify their participant status, then update ALL participants - causing last-write-wins behavior. Solution: Add SELECT ... FOR UPDATE locks on both mpc_sessions and participants tables at the start of the Update transaction. This serializes concurrent updates and prevents lost updates. Lock order: 1. Lock session row (FOR UPDATE) 2. Lock all participant rows for this session (FOR UPDATE) 3. Perform updates 4. Commit (releases locks) This ensures that concurrent ReportCompletion calls are fully serialized and each participant status update is preserved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .claude | ||
| backend | ||
| docs | ||
| frontend | ||
| kubernetes | ||
| scripts | ||
| tests | ||
| .gitignore | ||
| README.md | ||
| docker-compose.yml | ||