rwadurian/backend/mpc-system/services
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
..
account feat(mpc-system): add event sourcing for session tracking 2025-12-05 23:31:04 -08:00
message-router fix(proto): add party_index to JoinSessionResponse for correct index assignment 2025-12-06 00:08:47 -08:00
server-party fix(server-party): include self in participants list for keygen 2025-12-06 00:01:14 -08:00
server-party-api feat(mpc-system): add signing parties configuration and delegate signing support 2025-12-05 22:47:55 -08:00
session-coordinator fix(coordinator): add row-level locking to prevent concurrent update conflicts 2025-12-06 01:58:05 -08:00