feat: atomically create matchmaking proposals

This commit is contained in:
Josh Creek
2026-08-31 21:40:21 +01:00
parent 229ded8613
commit bf4da9fd39
4 changed files with 56 additions and 4 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func TestRetryableRecognisesPostgresSerializationAndDeadlockErrors(t *testing.T)
}
func TestClaimSQLContainsDurableOwnershipFences(t *testing.T) {
for _, fragment := range []string{"FOR UPDATE SKIP LOCKED", "state = 'QUEUED'", "proposal_participants", "revision = revision + 1"} {
for _, fragment := range []string{"FOR UPDATE SKIP LOCKED", "state = 'QUEUED'", "proposal_participants", "revision = revision + 1", "INSERT INTO proposals"} {
if !containsAnySQL(fragment) {
t.Fatalf("claim boundary missing %q", fragment)
}
@@ -27,7 +27,7 @@ func TestClaimSQLContainsDurableOwnershipFences(t *testing.T) {
}
func containsAnySQL(fragment string) bool {
return index(CandidateClaimSQL, fragment) >= 0 || index(ProposalParticipantInsertSQL, fragment) >= 0 || index(QueueTicketProposeSQL, fragment) >= 0
return index(CandidateClaimSQL, fragment) >= 0 || index(ProposalParticipantInsertSQL, fragment) >= 0 || index(QueueTicketProposeSQL, fragment) >= 0 || index(ProposalInsertSQL, fragment) >= 0
}
func index(s, fragment string) int {