canonical / canonical/jhack

Commands to list and trim the Ops deferred queue

Open
#228 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
60
Forks
31
Avg merge
2d 15h
Merged PRs (30d)
1

Description

Migrating from https://github.com/canonical/operator/issues/2101, where there is a request for:

* the ability for users to see the size of event queue (for deferred events). It will allow to provide customer estimates and plan hardware usage better, as differed event execution takes CPU)
* the ability to clean unnecessary events somehow. At the moment users have to go into sqlite on unit to clean the queue => the dangerous and risky way. Otherwise wait for hours/days wasting CPU/time.

For the former, perhaps something like `jhack defer-queue list` that prettily lists the deferred notices (the 4 fields in the notices table), with a total count somewhere. Potentially with the snapshot, although that makes it more expensive and noisy (if anyone wanted it, there could be a future `jhack defer-queue get x` that showed details for one row including the snapshot, maybe?).

For the latter, perhaps something like `jhack defer-queue clear [--duplicate]` that wipes the notices and snapshot tables, or if `--duplicate` is used, then only removes duplicates. If people wanted there could be future filtering ability like limiting it to specific events.

`--duplicate` is a bit odd in that modern Ops won't store duplicates, so you shouldn't really have any, but it is useful if you're using an old version of Ops and have duplicates to carefully remove.

@PietroPasotti if you're on board with adding this functionality and we can agree on what it should look like, I can contribute a PR for it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.