Browse Source
The ReftableCompactor supported a byteLimit, but this is currently unused. The FileReftableStack has a more sophisticated strategy that amortizes compaction costs. Rename min/maxUpdateIndex to reflogExpire{Min,Max}UpdateIndex to reflect their purpose more accurately. Since reflogs are generally pruned chronologically (oldest entries are expired first), one can only prune entries on full compaction, so they should not be set by default. Rephrase the function Reader#minUpdateIndex and maxUpdateIndex. These vars are documented to affect log entries, but semantically, they are about ref entries. Since ref entries have their timestamps delta-compressed, it is important for the min/maxUpdateIndex values to be coherent between different tables. The logical timestamps for log entries do not have to be coherent in different tables, as the timestamps of a log entry is part of the key. For example, a table written at update index 20 may contain a tombstone log entry at timestamp 1. Therefore, we set ReftableWriter's min/maxUpdateIndex from the merged tables we are compacting, rather than from the compaction settings (which should only control reflog expiry.) The previous behavior could drop log entries erroneously, especially in the presence of tombstone log entries. Unfortunately, testing this properly requires both an API for adding log tombstones, and a more refined API for controlling automatic compaction. Hence, no test. Change-Id: I2f4eb7866f607fddd0629809e8e61f0b9097717f Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>stable-5.6
Han-Wen Nienhuys
5 years ago
committed by
Matthias Sohn
6 changed files with 47 additions and 90 deletions
Loading…
Reference in new issue