[openstreetmap/openstreetmap-website] Update num_changes when backfilling changesets (PR #6361)

Andy Allan notifications at github.com
Wed Oct 8 16:31:02 UTC 2025


gravitystorm left a comment (openstreetmap/openstreetmap-website#6361)

So as I understand it, these counter discrepancies were (and still are, see #6379) coming from race conditions when handling changesets, which we are fixing separately.

I'm not super keen on huge SQL queries being run in production, without any unit tests! But at least this is only affecting the counter attributes, so the data can be recreated if something goes wrong. And given I'm not running it in production myself, then technically it's not my responsibility!

In future, I would be more comfortable with the queries and/or associated code being elsewhere (e.g. in a file in `lib/`) where it can be more easily tested (even just to catch syntax errors, or document expected behaviour) and the rake task just being a one-liner to call that code.

I'm going to merge this, but I haven't actually run it myself or verified that it correctly fixes incorrect `num_changes`, so caveat emptor!



-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6361#issuecomment-3382347461
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6361/c3382347461 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20251008/202c10b9/attachment.htm>


More information about the rails-dev mailing list