There is no way to clear the event log for a Node

Bug #1403080 reported by Graham Binns on 2014-12-16
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MAAS
High
Unassigned

Bug Description

See bug 1402237. It's possible for a Node to have tens of thousands of event log entries, but there's no way for a user to dispose of them should they no longer be needed.

tags: added: oil
Jason Hobbs (jason-hobbs) wrote :

These days, even trying to delete them with a manual SQL statement doesn't work. I tried this query, let it run for 90 minutes and then gave up:

maasdb=# delete from maasserver_event where id < 6000000;
^CCancel request sent
ERROR: canceling statement due to user request
CONTEXT: SQL statement "SELECT pg_notify('event_delete',CAST(OLD.id AS text))"
PL/pgSQL function event_delete_notify() line 4 at PERFORM

It takes about 20 seconds to delete 50k records.

Gavin Panella (allenap) wrote :

A couple of workarounds:

-- The nuclear option:
TRUNCATE TABLE maasserver_event;

-- A slightly nicer option:
ALTER TABLE maasserver_event DISABLE TRIGGER maasserver_event_event_delete_notify;
DELETE FROM maasserver_event WHERE id < 6000000;
ALTER TABLE maasserver_event ENABLE TRIGGER maasserver_event_event_delete_notify;

I'm not sure we actually want this trigger to be there; it's
automatically created to keep the UI up to date. For the event log I
think we could dispense with tracking DELETE.

Yeah we could get ride of that trigger, true its probably not needed. Jason
that trigger would have really slowed that operation down.
On Apr 21, 2015 5:15 PM, "Gavin Panella" <email address hidden>
wrote:

> A couple of workarounds:
>
> -- The nuclear option:
> TRUNCATE TABLE maasserver_event;
>
> -- A slightly nicer option:
> ALTER TABLE maasserver_event DISABLE TRIGGER
> maasserver_event_event_delete_notify;
> DELETE FROM maasserver_event WHERE id < 6000000;
> ALTER TABLE maasserver_event ENABLE TRIGGER
> maasserver_event_event_delete_notify;
>
> I'm not sure we actually want this trigger to be there; it's
> automatically created to keep the UI up to date. For the event log I
> think we could dispense with tracking DELETE.
>
> --
> You received this bug notification because you are subscribed to MAAS.
> https://bugs.launchpad.net/bugs/1403080
>
> Title:
> There is no way to clear the event log for a Node
>
> Status in MAAS:
> Triaged
>
> Bug description:
> See bug 1402237. It's possible for a Node to have tens of thousands of
> event log entries, but there's no way for a user to dispose of them
> should they no longer be needed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maas/+bug/1403080/+subscriptions
>

Changed in maas:
milestone: none → next
Jeff Lane (bladernr) wrote :

I see this now marked to Next... how soon is Next?

I have a node that has currently about 6000 log entries and the UI sometimes freezes trying to load them all (it loads for at least the last 30 days).

I want clear these items completely without resorting to SQL queries run on the maas server.

Andres Rodriguez (andreserl) wrote :

Hi!

We believe this is no longer an issue in the latest MAAS releases. As such, we are marking this bug report as invalid. If you believe this is still an issue, please re-open this bug report.

Thanks

Changed in maas:
status: Triaged → Invalid
Changed in maas:
status: Invalid → Triaged
importance: Medium → High
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers