diff --git a/docs/DESIGN.md b/docs/DESIGN.md index d095821..7adfd57 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -120,7 +120,7 @@ Three potential recovery strategies are supported to provide some flexibility fo - retain - on compaction KeyDeltas are retained in the Journal, only values are removed. -- recalc - the compaction rules assume that on recovery the key changes will be recalculated by comparing the change with the current database state. In recovery the key changes will be recalculated by comparing the change with the current database state. A user-defined function should be passed in at startup to achieve this recalculation (to override `leveled_head:diff_indexspeacs/3`). +- recalc - the compaction rules assume that on recovery the key changes will be recalculated by comparing the change with the current database state. In recovery the key changes will be recalculated by comparing the change with the current database state. A user-defined function should be passed in at startup to achieve this recalculation (to override `leveled_head:diff_indexspecs/3`). ### Hot Backups diff --git a/src/leveled_bookie.erl b/src/leveled_bookie.erl index 1aeea16..e1a2728 100644 --- a/src/leveled_bookie.erl +++ b/src/leveled_bookie.erl @@ -1109,7 +1109,7 @@ book_destroy(Pid) -> %% to store the backup. %% %% Backup files are hard-linked. Does not work in head_only mode, or if -%% index changes are used with a `skip` compaction/reload strategy +%% index changes are used with a `recovr` compaction/reload strategy book_hotbackup(Pid) -> gen_server:call(Pid, hot_backup, infinity). diff --git a/src/leveled_codec.erl b/src/leveled_codec.erl index 35ab5d1..d040723 100644 --- a/src/leveled_codec.erl +++ b/src/leveled_codec.erl @@ -89,7 +89,7 @@ -type ledger_kv() :: {ledger_key(), ledger_value()}. -type compaction_method() :: - retain|skip|recalc. + retain|recovr|recalc. -type compaction_strategy() :: list({tag(), compaction_method()}). -type journal_key_tag() :: @@ -375,7 +375,7 @@ inker_reload_strategy(AltList) -> -spec get_tagstrategy(ledger_key()|tag()|dummy, compaction_strategy()) - -> skip|retain|recalc. + -> compaction_method(). %% @doc %% Work out the compaction strategy for the key get_tagstrategy({Tag, _, _, _}, Strategy) -> diff --git a/src/leveled_iclerk.erl b/src/leveled_iclerk.erl index 0551a31..9f1256d 100644 --- a/src/leveled_iclerk.erl +++ b/src/leveled_iclerk.erl @@ -805,10 +805,11 @@ split_positions_into_batches(Positions, Journal, Batches) -> %% recalculating the KeyChanges by looking at the object when we reload. So %% old objects can be discarded. %% -%% If the strategy is skip, we don't care about KeyDeltas. Note though, that +%% If the strategy is recovr, we don't care about KeyDeltas. Note though, that %% if the ledger is deleted it may not be possible to safely rebuild a KeyStore %% if it contains index entries. The hot_backup approach is also not safe with -%% a `skip` strategy. +%% a `recovr` strategy. The recovr strategy assumes faults in the ledger will +%% be resolved via application-level anti-entropy filter_output(KVCs, FilterFun, FilterServer, MaxSQN, ReloadStrategy) -> FoldFun = filter_output_fun(FilterFun, FilterServer, MaxSQN, ReloadStrategy),