Replies: 3 comments
-
It's slow to delete the data in object storage, so we can't put all these inside single transaction. When a file is ready to delete (no more links), we put a record into database to track that, and start a background job to delete the data in background. The deletion can fail, we will retry that by scanning the tracking records. Until we delete all the data in object storage, we delete the tracking record. |
Beta Was this translation helpful? Give feedback.
-
You may follow the |
Beta Was this translation helpful? Give feedback.
-
JuiceFS using |
Beta Was this translation helpful? Give feedback.
-
A small code review was performed on the
Unlink()
call in juicefs. There are constructs in the transaction handling that seem problematic.Here is a pseudo-trace rundown of a file deletion from the FUSE layer.
deleteChunk()
starts new tx, does changes to the database and commits itdeleteChunk()
callsdeleteSlice()
deleteSlice()
callsm.newMsg(DeleteSlice)
which runs the user's callback (which removes object data, as initialized byregisterMetaMsg()
inmount()
)deleteSlice()
starts new tx, updates the database and commits itdoDeleteFileData()
starts a new tx, changes the database and commits itProblem P1:
Problem P2:
Summary:
Proposed solutions:
Other information:
Unlink()
call was reviewed. The general issue of how transactional semantics are applied may potentially be a concern for other top-level calls as well.Beta Was this translation helpful? Give feedback.
All reactions