storage icon indicating copy to clipboard operation
storage copied to clipboard

Container deletion inconsistency

Open mtrmac opened this issue 3 years ago • 0 comments

  • storage.Store.Delete(containerID) and storage.Store.DeleteContainer are separate implementations and out of sync; I think the two really should share code.
  • The Delete version removes $middleDir/$id/userdata directories, the DeleteContainer removes all of $middleDir/$id. The latter seems like a mistake — conceptually it interferes with containerStore being in charge of its own storage.

… actually, deleting the container and deleting the user data interferes either way, because containerStore.Delete removes all of $middleDir/$id, i.e. including the userdata subdirectory.

As long as os.RemoveAll is safe WRT concurrent removal, we can probably get away with that… — but, AFAICS, system.EnsureRemoveAll isn’t safe WRT concurrent removal.

mtrmac avatar Feb 14 '22 10:02 mtrmac