Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to delete database record if status is unchanged and yaml_file is pruned #81

Open
yorks opened this issue Jan 28, 2021 · 1 comment

Comments

@yorks
Copy link
Contributor

yorks commented Jan 28, 2021

In my case, it's already 1million records in database. I got 504 timeout.

I think, could be an option to delete this database recored, when status is unchanged and long time ago or yaml_file is prouned?

sqlite> select count( * ) from reports where state='unchanged' and yaml_file='pruned' ; count( * ) 1218629 sqlite> delete from reports where state='unchanged' and yaml_file='pruned' ; sqlite>

@skx
Copy link
Owner

skx commented Jan 28, 2021

It is already possible to update the database to remove the reports which are unchanged, via puppet-summary prune -unchanged, which was added as a result of #42. But I guess your bug-report is basically suggesting that the sheer size of the database is causing problems?

In that case I'd be inclined to either :

  • Suggest users use sqlite to do a deletion, almost as you have done.
  • Suggest we add a new puppet-summary sql filename.sql

The latter would just load and execute the contents of the named file against the SQLite database, removing the need for sqlite3 to be used manually.

That said I'm not really spending any time on this project at the moment, as noted in the last release announcement I no longer run puppet and prefer to spend my non-paid time working on projects I do use. I should probably make this clear in the README - though I don't want to mark the project archived in case any users to submit bug-reports, or pull-requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants