action #55634

Trying to delete single asset over /admin/assets does not seem to have any effect

Added by okurz 8 months ago. Updated 6 months ago.

Status:ResolvedStart date:16/08/2019
Priority:NormalDue date:
Assignee:Xiaojing_liu% Done:

0%

Category:Concrete Bugs
Target version:Current Sprint
Difficulty:
Duration:

Description

Observation

On https://openqa.suse.de/admin/assets I tried to delete the assets "iso/SLE12-SP5-Staging:P-Test-Server-DVD-x86_64-BuildP.34.3-Media.iso" and "iso/SLE12-SP5-Staging:P-Test-Server-DVD-x86_64-BuildP.34.2-Media.iso" which do not reference any latest job nor group. I clicked the little "x" button but there is no effect. Refreshing the page showed the assets again. Also I could not see anything related in logfiles, neither /var/log/openqa nor system journal.

History

#1 Updated by coolo 7 months ago

  • Target version set to Ready

#2 Updated by Xiaojing_liu 7 months ago

  • Assignee set to Xiaojing_liu
  • Target version changed from Ready to Current Sprint

#3 Updated by Xiaojing_liu 7 months ago

I read the code and did test in my environment. The asset had been removed from the database and the asset file (e.g xxx.iso or xxx.qcow2) had also been removed. The web page did not show successful information. And seems there is also something wrong in deleting the table tr. If my understanding is correct, the assets data shown in the table is come form the asset cache file, but after removing assets, the asset cache file is not refreshed. So, should the cache file be refreshed after removing assets by clicking the 'x' picture?

#4 Updated by mkittler 7 months ago

This is a problem I've (knowingly) introduced when implementing the cache. The reason is that it just takes quite long to generate the asset table's contents. So refreshing the entire table after contents deleting a single row makes no sense.

@okurz Did you check whether the asset has been removed from the database table and from the file system? If that works it is sufficient in my opinion. We could add a note so people are aware of that limitation. It should also be possible to re-trigger the cache generation. This should refresh the view.

If we really wanted to fix this we needed to have all information in the database (without the need to compute data on the fly). At the time I thought it wasn't worth the effort. Note that removing an asset also has an impact on the size compution and on the list under the table. That would go "out-of-sync" when one just deletes the row from the database. So making this work altogether is quite a task and again I'm not sure whether it is worth the effort.

@Xiaojing_liu To answer your concrete questions:

The asset had been removed from the database and the asset file (e.g xxx.iso or xxx.qcow2) had also been removed.

That's good and actually good enough in my opinion.

If my understanding is correct, the assets data shown in the table is come form the asset cache file, but after removing assets, the asset cache file is not refreshed.

That's correct.

So, should the cache file be refreshed after removing assets by clicking the 'x' picture?

No, it would take annoyingly long to refresh the entire cache.

#5 Updated by okurz 7 months ago

mkittler wrote:

This is a problem I've (knowingly) introduced when implementing the cache. The reason is that it just takes quite long to generate the asset table's contents. So refreshing the entire table after contents deleting a single row makes no sense.


@okurz Did you check whether the asset has been removed from the database table and from the file system? If that works it is sufficient in my opinion. We could add a note so people are aware of that limitation. It should also be possible to re-trigger the cache generation. This should refresh the view.

[…]

Hm, now I am not sure anymore if the asset got actually deleted but did just not disappear from the table view or if I had to delete the files manually myself. I think a message that just shows confirmation of the delete request would be fine. Maybe we can hint to clicking the "Trigger asset cleanup" button to make the change and visual representation effective. Then the longer processing time is acceptable as it is explicitly triggered by the user.

#7 Updated by Xiaojing_liu 6 months ago

  • Status changed from New to In Progress

#8 Updated by Xiaojing_liu 6 months ago

  • Status changed from In Progress to Feedback

#9 Updated by Xiaojing_liu 6 months ago

  • Status changed from Feedback to Resolved

Also available in: Atom PDF