Safely delete foundationdb directory

111 Views Asked by At

I want to delete a foundationDB directory and all it's contents. However, DirectoryLayer::remove states:

Warning: Clients that have already opened the directory might still insert data into its contents after it is removed.

Is there a way for me to transactionally remove a directory? I.e. after the delete transaction gets committed, the directory is completely gone. If there is a conflicting transaction that is adding to the directory, at most one succeeds?

1

There are 1 best solutions below

0
On

FoundationDB is implementing its directory as designated key, e.g. Dir1/Dir2/Dir3/Key will be translated to something like

Dir1/Dir2/Dir3/Key

thus, deleting a directory implies a clear range internally. This can be and is done transactionally. However, it is not possible to prevent additional keys, like

Dir1/Dir2/Dir3/KeyAdditional

being inserted after the directory is deleted, since the directory only exists conceptually, not internally.