Delete calculation results in OQ-engine
Bug #1117052 reported by
Marco Pagani
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenQuake (deprecated) |
Fix Released
|
High
|
Lars Butler |
Bug Description
OQ currently stores in the DB all the results of the performed calculations. There are however some results that aren't relevant and the user might wish to remove from the DB. For this purpose it would be useful to have a --dhc function in OQ.
Changed in openquake: | |
status: | New → In Progress |
assignee: | nobody → Lars Butler (lars-butler) |
milestone: | none → 0.9.2 |
importance: | Undecided → High |
Changed in openquake: | |
status: | In Progress → Fix Committed |
Changed in openquake: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Here are a couple of key points I propose for the implementation of this feature:
- This action should only be done by the `oq_admin` DB user calculation` records belonging to himself/herself (see `hazard_ calculation. owner_id` ). hazard- calculation| --dhc` and `--delete- risk-calculatio n|--drc` .
- A user should only be able to delete `hazard_
- All DELETE privileges should be removed for all tables and only granted to the `oq_admin` user, with the exception of tables in the `htemp` schema space. DELETE privileges for `htemp` can remain with `oq_reslt_writer`.
- Add a command line option for `--delete-
- Invoking this should ask for confirmation from the user
- For the purpose of running this command in a script or similar context, add a `--yes|-y` option to automatically confirm.
--dhc/--drc would delete everything associated with the calculation, including `oq_job` records and output artifact. It will NOT remove inputs.
Another point to think about/discuss: Perhaps it would be useful also to be able to delete individual outputs, instead of entire calculations. Given the time we have planned for this task, I think this functionality could be added as well.