titan icon indicating copy to clipboard operation
titan copied to clipboard

Questions regarding how beginners can understand the detailed design related to garbage collection in the Titan source code.

Open Yxlfe opened this issue 1 year ago • 1 comments

Hello, as a beginner in Titan, I haven't found any detailed design documents related to Titan. While researching the relevant design in the source code, I found it difficult to understand some of the explanations in the comments. For example, in the enum class FileState : int:

enum class FileState : int { kInit, // file never at this state kNormal, kPendingLSM, // waiting keys adding to LSM kBeingGC, // being gced kPendingGC, // output of gc, waiting gc finish and keys adding to LSM kObsolete, // already gced, but wait to be physical deleted kToMerge, // need merge to new blob file in next compaction };

I am having trouble understanding the difference between the kPendingLSM and kPendingGC states in terms of their specific scenarios. Please answer my question regarding kPendingLSM and kPendingGC, and if possible, provide a link to the relevant detailed design documents. I would greatly appreciate it.

Yxlfe avatar Aug 29 '24 11:08 Yxlfe

There is no detailed design for FileState. For kPendingLSM, the blob file is created during flush. For kPendingGC, the blob file is created during GC,

Connor1996 avatar Nov 12 '24 07:11 Connor1996