Project

General

Profile

Actions

Feature #12163

closed

Add ability to expire facts based on fact name.

Added by Ryan Sabatini over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Facts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Currently there isn't a way to expire old facts that are no longer being collected from the database. This feature adds a rake task similar to reports:expire to delete facts based on the provided fact name.


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #16576: Structured facts importer is extremely slowClosedDominic Cleal09/15/2016Actions
Has duplicate Foreman - Feature #18479: Add a rake task to cleanup facts that are not used anymoreDuplicateMarek Hulán02/13/2017Actions
Actions #1

Updated by Ohad Levy over 8 years ago

  • Status changed from New to Need more information

once new facts comes in, old facts (e.g. facts that dont exists in the new facts set) gets deleted automatically.

Actions #2

Updated by Ryan Sabatini over 8 years ago

Ohad Levy wrote:

once new facts comes in, old facts (e.g. facts that dont exists in the new facts set) gets deleted automatically.

If I stop collecting a custom fact or rename the custom fact, does that fact automatically get deleted? The main reason I came up with the solution is that we were collecting some poorly built custom facts that resulted in ~174k fact_name entries and ~12 million fact values in the database. The sheer volume of the facts broke the javascript on the drop down box for "Trendable" when creating a new trend counter.

We have since stopped collecting the facts that were adding the extra entries that we weren't really using. I have come up with a coded solution similar to reports:expire that allows me to delete the fact name and values for the fact names that we are not longer collecting which allowed me to get the total values down far enough to use the trendable drop down box to create a new trend.

Actions #3

Updated by Dominic Cleal over 8 years ago

  • Status changed from Need more information to New

Ryan Sabatini wrote:

Ohad Levy wrote:

once new facts comes in, old facts (e.g. facts that dont exists in the new facts set) gets deleted automatically.

If I stop collecting a custom fact or rename the custom fact, does that fact automatically get deleted?

It should delete the fact values, but not the fact names. If there were many custom fact names added, as you suggest, then these don't get cleaned up during an import of facts for a host (assuming no other host has a value for it).

I'm changing the ticket status as I think what you're describing is valid.

Actions #4

Updated by Dominic Cleal over 7 years ago

  • Related to Bug #16576: Structured facts importer is extremely slow added
Actions #5

Updated by Marek Hulán about 7 years ago

  • Has duplicate Feature #18479: Add a rake task to cleanup facts that are not used anymore added
Actions #6

Updated by The Foreman Bot about 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Marek Hulán
  • Pull request https://github.com/theforeman/foreman/pull/4275 added
Actions #7

Updated by Marek Hulán about 7 years ago

  • Bugzilla link set to 1422458
Actions #8

Updated by Marek Hulán about 7 years ago

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

Updated by Dominic Cleal about 7 years ago

  • translation missing: en.field_release set to 209
Actions

Also available in: Atom PDF