Project

General

Profile

Bug #11444

Domains page shows negative number of hosts

Added by Simon Wydooghe over 4 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

I only have one domain. In the Domains page, this one domain shows '-53' hosts. The Environments page shows my two environments with 9 and 167 hosts, which sounds about right. All my hosts are assigned to this one domain.

This was the case in 1.8.2, and it remains like this after upgrading to 1.9.0 this morning.


Related issues

Related to Foreman - Bug #5692: Puppet environment counters not updatedClosed2014-05-13
Related to Foreman - Bug #12193: Deadlock occuring when creating hostClosed2015-10-16
Related to Foreman - Bug #12455: Deprecation warning when writing total_hosts attributeRejected2015-11-12
Related to Foreman - Bug #11044: rake fix_cached_counters fails "undefined method `counter_cache_column' for nil:NilClass"Duplicate2015-07-07
Has duplicate Foreman - Bug #13944: foreman-rake fix_cached_counters fails.Duplicate2016-02-29

Associated revisions

Revision a152a1b2 (diff)
Added by Tomer Brisker about 4 years ago

Fixes #11444 - Correctly count hosts in domain

Only hosts that have a primary nic assigned to a domain should be
counted in the domain host count. Previous implementation was flawed in
that it only updated the counter in certain occasions and not all,
leading sometimes to incorrect host counts.
I have implemented the counter updates in `after_commit` to reduce
chance of deadlocks.

History

#1 Updated by Dominic Cleal over 4 years ago

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

#2 Updated by Dominic Cleal over 4 years ago

  • Status changed from New to Feedback

Please try running foreman-rake fix_cached_counters to recount everything. If it gets out of sync again, please re-open the bug as perhaps one of our fixes for it (in #5692 and related) didn't work. Thanks!

#3 Updated by Simon Wydooghe over 4 years ago

That worked! I'll re-open if it happens again. Thanks, Dominic. Enjoy your weekend!

#4 Updated by The Foreman Bot about 4 years ago

  • Status changed from Feedback to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2840 added
  • Pull request deleted ()

#5 Updated by Tomer Brisker about 4 years ago

  • Category set to Database
  • Assignee set to Tomer Brisker

#6 Updated by Tomer Brisker about 4 years ago

  • Related to Bug #12193: Deadlock occuring when creating host added

#7 Updated by Dominic Cleal about 4 years ago

  • Legacy Backlogs Release (now unused) set to 71

#8 Updated by Anonymous about 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#9 Updated by Dominic Cleal about 4 years ago

  • Related to Bug #12455: Deprecation warning when writing total_hosts attribute added

#10 Updated by Brandon Weeks about 4 years ago

  • Related to Bug #11044: rake fix_cached_counters fails "undefined method `counter_cache_column' for nil:NilClass" added

#11 Updated by Dominic Cleal almost 4 years ago

  • Has duplicate Bug #13944: foreman-rake fix_cached_counters fails. added

Also available in: Atom PDF