2. The Two Component LSM-Tree Algorithm(3)
The rolling merge acts in a series of merge steps.
回滚合并操作是一系列合并步骤。
A read of a multi-page block containing leaf nodes of the C1 tree makes a range of entries in C1 buffer resident.
读取多页C1树叶子节点内容,排序存储在C1点缓存内。
Each merge step then reads a disk page sized leaf node of the C1 tree buffered in this block, merges entries from the leaf node with entries taken from the leaf level of the C0 tree, thus decreasing the size of C0, and creates a newly merged leaf node of the C1 tree.
每次在缓存读取一个磁盘页大小的内容,和C0合并,这样C0变大,创建一个新的C1节点。
The buffered multi-page block containing old C1 tree nodes prior to merge is called the emptying block, and new leaf nodes are written to a different buffered multi-page block called the filling block.
包含旧节点的多页块被称为空块,新内容写入新的填充块。
When this filling block has been packed full with newly merged leaf nodes of C1, the block is written to a new free area on disk.
当新的填充快填满C1的节点,写入磁盘空闲区域。
The new multi-page block containing merged results is pictured in Figure 2.2 as lying on the right of the former nodes.
新内容在图2.2的右边。
Subsequent merge steps bring together increasing index value segments of the C0 and C1 components until the maximum values are reached and the rolling merge starts again from the smallest values.
后续的合并步骤导致索引段不断增长直到达到最大值,再次从最小开始合并。
Newly merged blocks are written to new disk positions, so that the old blocks will not be overwritten and will be available for recovery in case of a crash.
新内容写入磁盘新位置,旧的磁盘块不会被覆盖,在程序挂掉的情况下还可以恢复。
The parent directory nodes in C1, also buffered in memory, are updated to reflect this new leaf structure, but usually remain in buffer for longer periods to minimize I/O;
C1中的父目录也在缓存中,会更新叶子节点的机构,但一般会在缓存保存一段时间来减少I/O操作;
the old leaf nodes from the C1 component are invalidated after the merge step is complete and are then deleted from the C1 directory.
旧的叶子结点在合并完成后就失效了,之后会在C1的目录中删除。
In general, there will be leftover leaf-level entries for the merged C1 component following each merge step, since a merge step is unlikely to result in a new node just as the old leaf node empties.
一般情况下,每个合并步骤会有失效的叶子节点,但是不一定有新的节点,只是有旧的空节点。
The same consideration holds for multi-page blocks, since in general when the filling block has filled with newly merged nodes, there will be numerous nodes containing entries still in the shrinking block.
对于多页块也同样需要考虑,因为通常当填充块已经填充了新合并的节点时,仍然会有许多包含条目的节点在收缩的块中。(有道翻译)
These leftover entries, as well as updated directory node information, remain in block memory buffers for a time without being written to disk.
失效的内容,随着更新目录信息,仍然会保存一段时间才会写入磁盘。
Techniques to provide concurrency during the merge step and recovery from lost memory during a crash are covered in detail in Section 4.
合并和恢复相关并发处理在第四章。
To reduce reconstruction time in recovery, checkpoints of the merge process are taken periodically, forcing all buffered information to disk.
为了减少恢复操作内容,会周期性的保存一个检查点保存所有缓存内容到磁盘。