From 47706a53fe246d0d889e81d13a5a49058dde8639 Mon Sep 17 00:00:00 2001 From: Martin Sumner Date: Mon, 23 Dec 2024 10:55:48 +0000 Subject: [PATCH] Change default to `recalc` (#51) 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. --- priv/riak_kv.schema | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/priv/riak_kv.schema b/priv/riak_kv.schema index ebb54764b..1786a4e68 100644 --- a/priv/riak_kv.schema +++ b/priv/riak_kv.schema @@ -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} ]}.