rwadurian/backend/mpc-system/services/session-coordinator
hailin 380bf46fb6 fix(coordinator): add row-level locking to prevent concurrent update conflicts
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>
2025-12-06 01:58:05 -08:00
..
adapters fix(coordinator): add row-level locking to prevent concurrent update conflicts 2025-12-06 01:58:05 -08:00
application fix(coordinator): handle all participant states in ReportCompletion with proper state transitions 2025-12-06 01:09:49 -08:00
cmd/server feat(mpc-system): integrate reliability mechanisms and enable party-driven architecture 2025-12-05 20:30:03 -08:00
domain feat(mpc-system): add signing parties configuration and delegate signing support 2025-12-05 22:47:55 -08:00
infrastructure feat(mpc-system): integrate reliability mechanisms and enable party-driven architecture 2025-12-05 20:30:03 -08:00
Dockerfile chore(mpc-system): update Dockerfiles to Go 1.24 and fix line endings 2025-12-05 16:40:32 -08:00