owncloud / owncloud/ocis

Properly deleting ocis spaces

Open
#8,657 2 comments 0 reactions 0 assignees View on GitHub
Priority:p3-medium Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

There are some issues when ocis encounters unexpected problem during deleting of spaces.

## Description of the problem

When ocis is deleting a space it is basically doing a `os. RemoveAll` from the space root. This will recursively delete all files and folders in this space. However if ocis breaks during that process (let's _imagine_ it panics because of a `PostprocessingFinished` event targeting exactly this space) then the space remains half deleted on the disc.

## How to fix this

We need a way to detect such half deleted spaces so we can remove them. Maybe we can mark the space root somehow? Rename it by prefixing with `D` before deleting? (or some other prefix, a uuid could start with `D`)

## How to automate this

We need a cli command that can be used to finish deletion of such spaces. As soon as the space is marked this should not be a problem. But we need to be extremely careful not the delete ordinary spaces!

## Change behaviour of postprocessing

We should double check how we want postprocessing to react if
- the space the file should go to is already deleted
- the parent folder of the file is already deleted
- are there other unrecoverable errors?

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.