ActiveRecord::Deadlocked retry_on re-execution risk for non-idempotent writes
ActiveRecord::Base.retry_on is documented to automatically retry on database errors such as ActiveRecord::Deadlocked. The retry is implemented by re-executing the entire transaction block from the start rather than resuming mid-statement. Because the block is re-run, non-idempotent operations inside the block can execute multiple times. This includes counter