Project

General

Profile

Bug #8316

Removing a long-standing host creates huge transaction

Added by Daniel Lobato Garcia almost 8 years ago. Updated about 4 years ago.

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

Description

Removing a host with some reports (say 200), and each of them with several log lines (10000) generates 2.000.000 DELETE sql statements in the same transaction.
More often than not, ActiveRecord won't be able to make such a big transaction, in fact it will likely eat all memory available and Foreman will stop working in that host. In the best scenario the DB will end up with a non-committed giant transaction.

I suggest deleting hosts and reports manually on host destroy to avoid this.


Related issues

Related to Foreman - Bug #8565: report::expire is running very slowlyClosed2014-12-03
Related to Foreman - Refactor #1955: improve host deletion speedNew2012-11-18

Associated revisions

Revision 3e750719 (diff)
Added by Daniel Lobato Garcia over 7 years ago

Fixes #8316: Removing a host can create a huge transaction

Revision 09b476b4 (diff)
Added by Daniel Lobato Garcia over 7 years ago

Fixes #8316: Removing a host can create a huge transaction

(cherry picked from commit 3e7507198f25b41b90a55115671fe0edd495f531)

History

#1 Updated by The Foreman Bot almost 8 years ago

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

#2 Updated by Dominic Cleal almost 8 years ago

  • Category set to Database
  • Assignee set to Daniel Lobato Garcia

#3 Updated by Dominic Cleal over 7 years ago

  • Related to Bug #8565: report::expire is running very slowly added

#4 Updated by Daniel Lobato Garcia over 7 years ago

#5 Updated by Daniel Lobato Garcia over 7 years ago

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

#6 Updated by Dominic Cleal over 7 years ago

  • Legacy Backlogs Release (now unused) set to 28

Also available in: Atom PDF