Skip to content

Commit

Permalink
Change default to recalc (#51)
Browse files Browse the repository at this point in the history
The default has been recommended for several years, and major customers have used it.  However, the recommendation was only made via release notes so may have been missed by some.

When the change was first made, there was some nervousness about the potential scope of the change and its irreversability - hence why it was not immediately the default.  However, sufficient time has passed to put-aside those concerns.
  • Loading branch information
martinsumner authored Dec 23, 2024
1 parent 5c69298 commit 47706a5
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions priv/riak_kv.schema
Original file line number Diff line number Diff line change
Expand Up @@ -1471,23 +1471,30 @@
{commented, 900}
]}.

%% @doc Enable the `recalc` compaction strategy within the leveled backend in
%% riak. The default (when disabled) is `retain`, but this will leave
%% uncollected garbage within the, journal.
%% It is now recommended from Riak KV 2.9.2 to consider the `recalc` strategy.
%% @doc Enable the `recalc` compaction strategy
%% This is relevant only to the leveled backend. If disabled the `retain`
%% strategy will be used, but this will leave uncollected garbage within the
%% journal.
%%
%% The default `retain` strategy retains a history of key changes in the
%% journal, whereas the `recalc` strategy discards that history, but will redo
%% a diff_index_specs calculation when reloading each object.
%%
%% It is recommended to use the `recalc` strategy.
%%
%% This strategy has a side effect of slower startups, and slower recovery
%% from a wiped ledger - but it will not keep an overhead of garbage within
%% the Journal.
%%
%% It should be possible to move from `retain` to `recalc` via configuration
%% change. However, it is not possible to switch from `recalc` back to
%% `retain`. This switch can only be made for new nodes receiving data
%% through riak transfers (not inheriting data on disk).
%% The default `retain` strategy retains a history of key changes in the
%% journal, whereas the `recalc` strategy discards that history, but will redo
%% a diff_index_specs calculation when reloading each object.
%% `retain` just by reverting the config. This switch can only be made for
%% new nodes receiving data through riak transfers (not inheriting data on
%% disk) - so a rolling `riak admin cluster replace` would be required to
%% revert to `retain`.
{mapping, "leveled_reload_recalc", "riak_kv.leveled_reload_recalc", [
{datatype, {flag, enabled, disabled}},
{default, disabled},
{default, enabled},
{commented, enabled}
]}.

Expand Down

0 comments on commit 47706a5

Please sign in to comment.