LSM-Tree(53)

4.2. Recovery in the LSM-tree(3)

Once this checkpoint information has been placed on disk, we can resume regular operations of the LSM-tree. In the event of a crash and subsequent restart, this checkpoint can be located and the saved component C0 loaded back into memory, together with the buffered blocks of other components needed to continue rolling merges. Then logs starting with the first LSN after LSN0 are read into memory and have their associated index entries entered into the LSM-tree. As of the time of the checkpoint, the positions of all disk-based components containing all indexing information were recorded in component directories starting at the roots, whose locations are known from the checkpoint log. None of this information has been wiped out by later writes of multi-page disk blocks since these writes are always to new locations on disk until subsequent checkpoints make outmoded multi-page blocks unnecessary. As we recover logs of inserts for indexed rows, we place new entries into the C0 component; now the rolling merge starts again, overwriting any multi-page blocks written since the checkpoint, but recovering all new index entries, until the most recently inserted row has been indexed and recovery is complete.
一旦将检查点信息放在磁盘上,我们就可以恢复lsm -树的常规操作。在发生崩溃和随后的重启时,可以定位这个检查点,并将保存的组件C0加载回内存,以及继续滚动合并所需的其他组件的缓冲块。然后,从LSN0之后的第一个LSN开始的日志被读入内存,并将它们相关联的索引项输入到LSM-tree中。在检查点出现时,包含所有索引信息的所有基于磁盘的组件的位置都记录在从根开始的组件目录中,它们的位置可以通过检查点日志得知。这些信息不会在以后写多页磁盘块时被抹去,因为这些写操作总是在磁盘上的新位置,直到后来的检查点使过时的多页磁盘块变得不必要为止。当我们恢复索引行的插入日志时,我们将新条目放入C0组件中;现在滚动合并再次开始,覆盖自检查点以来写入的任何多页块,但恢复所有新的索引项,直到最近插入的行已建立索引并完成恢复。(有道翻译)

todo:自己翻译,仔细阅读

你可能感兴趣的:(LSM-Tree(53))