yesodweb / yesodweb/persistent
Atomic insertUnique support
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
#913 explains the issue well.
For a short summary though insertUnique's default implementation suffers from concurrency issues if a write occurs between the conflict check and the insertion.
The way to get around this in PostgreSQL is to use ON CONFLICT instead of trying to check in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue #913 and locating the default insertUnique implementation and PostgreSQL backend code in the persistent repository. Confirm how the conflict check and insertion are separated; done when PostgreSQL insertUnique uses ON CONFLICT atomically without the race described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, postgresql
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100