Project

General

Profile

Bug #7246

Remove counter workaround for #5692 on upgrade to rails 4.x

Added by Tomer Brisker almost 6 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Rails
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Related issues

Related to Foreman - Bug #5692: Puppet environment counters not updatedClosed2014-05-13
Related to Foreman - Refactor #12485: Consider replacing Rails counter_cache with counter_culture gemRejected2015-11-15
Related to Foreman - Tracker #3157: Rails 4.1 upgrade tasksClosed2013-09-27

Related to Foreman - Bug #10133: Massive db deadlocks in postgres from hosts_counter updates with counter_cache_fix.rbClosed2015-04-14
Blocked by Foreman - Feature #7230: Upgrade Ruby on Rails to 4.1Closed2014-08-22

History

#1 Updated by Tomer Brisker almost 6 years ago

  • Related to Bug #5692: Puppet environment counters not updated added

#2 Updated by Tomer Brisker almost 6 years ago

#3 Updated by Ohad Levy almost 6 years ago

  • Legacy Backlogs Release (now unused) set to 21

#4 Updated by Ohad Levy almost 6 years ago

  • Legacy Backlogs Release (now unused) deleted (21)

#5 Updated by Tom Caspy over 5 years ago

this can't be removed if we want associations to be updated by the association_id setter.
we get this:

1) Failure:
DomainTest#test_0010_should update hosts_count on domain_id change [/Volumes/proj/foreman/test/unit/domain_test.rb:87]:
"domain.hosts_count" didn't change by 1.
Expected: 1
Actual: 0

when removing this patch.

#6 Updated by Dominic Cleal over 4 years ago

  • Subject changed from Remove workaround for #5692 on upgrade to rails 4.x to Remove counter workaround for #5692 on upgrade to rails 4.x
  • Category set to Rails

#7 Updated by Dominic Cleal over 4 years ago

#8 Updated by Dominic Cleal over 4 years ago

#9 Updated by Dominic Cleal over 4 years ago

#10 Updated by Dominic Cleal over 4 years ago

  • Related to Refactor #12485: Consider replacing Rails counter_cache with counter_culture gem added

#11 Updated by Dominic Cleal over 4 years ago

#12 Updated by Dominic Cleal over 4 years ago

#13 Updated by Dominic Cleal over 4 years ago

An issue remains in Rails 4 (4.1.14.1, 4.2.5 and master at the time of writing) where counters are double-counted on object reassignment, preventing this workaround from being removed still. Filed as https://github.com/rails/rails/issues/23265.

Unfortunately this means I think that counters are being updated three times on reassignment - twice by Rails and once by our workaround.

#14 Updated by Tomer Brisker about 4 years ago

  • Related to Bug #10133: Massive db deadlocks in postgres from hosts_counter updates with counter_cache_fix.rb added

#15 Updated by Dominic Cleal almost 4 years ago

  • Status changed from New to Rejected

Cached counters were removed entirely in #12193, so this ticket is no longer applicable.

Also available in: Atom PDF