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/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev