[openstreetmap/openstreetmap-website] Lock note during status update to avoid race condition (PR #5053)
Tom Hughes
notifications at github.com
Wed Aug 7 17:37:17 UTC 2024
Locking is actually one place where I'm not very good because most of my work with databases is only on reading not on making updates so I don't normally have to worry about them.
I think the locks are necessary because the default isolation level in Postgres is `read committed` and you would have to run at `repeatable read` for write conflicts to be detected automatically. Even then it would only work for writes to the note objects and wouldn't prevent duplicate comments as that involves the creation of separate objects that wouldn't clash.
So yes, this looks reasonable to me.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5053#issuecomment-2273986845
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/5053/c2273986845 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240807/6b35c912/attachment.htm>
More information about the rails-dev
mailing list