rwadurian/backend/mpc-system/services/session-coordinator
hailin b72268c1ce feat(mpc-system): implement optimistic locking for session updates
Implement version-based optimistic locking to prevent concurrent update conflicts
when multiple parties simultaneously report completion during keygen operations.

Changes:
- Add version column to mpc_sessions table (migration 004)
- Add Version field to MPCSession entity
- Define ErrOptimisticLockConflict error
- Update SessionPostgresRepo.Update() to check version and increment on success
- Add automatic retry logic (max 3 attempts) to ReportCompletionUseCase
- Update Save and all query methods (FindByStatus, FindExpired, etc.) to handle version field

This replaces pessimistic locking (FOR UPDATE) with optimistic locking using
the industry-standard pattern: WHERE version = $n and checking rowsAffected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-06 04:16:32 -08:00
..
adapters feat(mpc-system): implement optimistic locking for session updates 2025-12-06 04:16:32 -08:00
application feat(mpc-system): implement optimistic locking for session updates 2025-12-06 04:16:32 -08:00
cmd/server test(logger): add debug log test to verify debug level works 2025-12-06 03:23:24 -08:00
domain feat(mpc-system): implement optimistic locking for session updates 2025-12-06 04:16:32 -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