Merge branch 'mas-qc-inkercompaction' into mas-i249-iclerkshutdown
This commit is contained in:
commit
00a59f4f8f
8 changed files with 1283 additions and 9 deletions
BIN
.eqc-info
Normal file
BIN
.eqc-info
Normal file
Binary file not shown.
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -5,3 +5,6 @@
|
||||||
.DS_Store
|
.DS_Store
|
||||||
rebar.lock
|
rebar.lock
|
||||||
test/test_area/*
|
test/test_area/*
|
||||||
|
cover
|
||||||
|
cover_*
|
||||||
|
.eqc-info
|
||||||
|
|
BIN
current_counterexample.eqc
Normal file
BIN
current_counterexample.eqc
Normal file
Binary file not shown.
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
{profiles,
|
{profiles,
|
||||||
[{eqc, [{deps, [meck, fqc]},
|
[{eqc, [{deps, [meck, fqc]},
|
||||||
{erl_opts, [debug_info, {parse_transform, lager_transform}, {parse_transform, eqc_cover}]},
|
{erl_opts, [debug_info, {parse_transform, eqc_cover}]},
|
||||||
{plugins, [rebar_eqc]}]}
|
{extra_src_dirs, ["test"]}]}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
{deps, [
|
{deps, [
|
||||||
|
|
|
@ -62,6 +62,7 @@
|
||||||
book_headonly/4,
|
book_headonly/4,
|
||||||
book_snapshot/4,
|
book_snapshot/4,
|
||||||
book_compactjournal/2,
|
book_compactjournal/2,
|
||||||
|
book_eqccompactjournal/2,
|
||||||
book_islastcompactionpending/1,
|
book_islastcompactionpending/1,
|
||||||
book_trimjournal/1,
|
book_trimjournal/1,
|
||||||
book_hotbackup/1,
|
book_hotbackup/1,
|
||||||
|
@ -100,8 +101,8 @@
|
||||||
-include_lib("eunit/include/eunit.hrl").
|
-include_lib("eunit/include/eunit.hrl").
|
||||||
|
|
||||||
-define(CACHE_SIZE, 2500).
|
-define(CACHE_SIZE, 2500).
|
||||||
-define(MIN_CACHE_SIZE, 100).
|
-define(MIN_CACHE_SIZE, 1).
|
||||||
-define(MIN_PCL_CACHE_SIZE, 400).
|
-define(MIN_PCL_CACHE_SIZE, 4).
|
||||||
-define(MAX_PCL_CACHE_SIZE, 28000).
|
-define(MAX_PCL_CACHE_SIZE, 28000).
|
||||||
% This is less than actual max - but COIN_SIDECOUNT
|
% This is less than actual max - but COIN_SIDECOUNT
|
||||||
-define(CACHE_SIZE_JITTER, 25).
|
-define(CACHE_SIZE_JITTER, 25).
|
||||||
|
@ -1005,6 +1006,7 @@ book_snapshot(Pid, SnapType, Query, LongRunning) ->
|
||||||
|
|
||||||
|
|
||||||
-spec book_compactjournal(pid(), integer()) -> ok|busy.
|
-spec book_compactjournal(pid(), integer()) -> ok|busy.
|
||||||
|
-spec book_eqccompactjournal(pid(), integer()) -> {ok, pid()}.
|
||||||
-spec book_islastcompactionpending(pid()) -> boolean().
|
-spec book_islastcompactionpending(pid()) -> boolean().
|
||||||
-spec book_trimjournal(pid()) -> ok.
|
-spec book_trimjournal(pid()) -> ok.
|
||||||
|
|
||||||
|
@ -1013,8 +1015,13 @@ book_snapshot(Pid, SnapType, Query, LongRunning) ->
|
||||||
%% the scheduling of Journla compaction is called externally, so it is assumed
|
%% the scheduling of Journla compaction is called externally, so it is assumed
|
||||||
%% in Riak it will be triggered by a vnode callback.
|
%% in Riak it will be triggered by a vnode callback.
|
||||||
|
|
||||||
|
book_eqccompactjournal(Pid, Timeout) ->
|
||||||
|
{_R, P} = gen_server:call(Pid, {compact_journal, Timeout}, infinity),
|
||||||
|
{ok, P}.
|
||||||
|
|
||||||
book_compactjournal(Pid, Timeout) ->
|
book_compactjournal(Pid, Timeout) ->
|
||||||
gen_server:call(Pid, {compact_journal, Timeout}, infinity).
|
{R, _P} = gen_server:call(Pid, {compact_journal, Timeout}, infinity),
|
||||||
|
R.
|
||||||
|
|
||||||
%% @doc Check on progress of the last compaction
|
%% @doc Check on progress of the last compaction
|
||||||
|
|
||||||
|
|
|
@ -347,7 +347,7 @@ ink_loadpcl(Pid, MinSQN, FilterFun, Penciller) ->
|
||||||
as_ink},
|
as_ink},
|
||||||
infinity).
|
infinity).
|
||||||
|
|
||||||
-spec ink_compactjournal(pid(), pid(), integer()) -> ok|busy.
|
-spec ink_compactjournal(pid(), pid(), integer()) -> {ok|busy, pid()}.
|
||||||
%% @doc
|
%% @doc
|
||||||
%% Trigger a compaction event. the compaction event will use a sqn check
|
%% Trigger a compaction event. the compaction event will use a sqn check
|
||||||
%% against the Ledger to see if a value can be compacted - if the penciller
|
%% against the Ledger to see if a value can be compacted - if the penciller
|
||||||
|
@ -565,9 +565,10 @@ handle_call({compact,
|
||||||
CloseFun,
|
CloseFun,
|
||||||
FilterFun},
|
FilterFun},
|
||||||
_From, State) ->
|
_From, State) ->
|
||||||
|
Clerk = State#state.clerk,
|
||||||
case State#state.compaction_pending of
|
case State#state.compaction_pending of
|
||||||
true ->
|
true ->
|
||||||
{reply, busy, State};
|
{reply, {busy, Clerk}, State};
|
||||||
false ->
|
false ->
|
||||||
Manifest = leveled_imanifest:to_list(State#state.manifest),
|
Manifest = leveled_imanifest:to_list(State#state.manifest),
|
||||||
leveled_iclerk:clerk_compact(State#state.clerk,
|
leveled_iclerk:clerk_compact(State#state.clerk,
|
||||||
|
@ -576,7 +577,7 @@ handle_call({compact,
|
||||||
CloseFun,
|
CloseFun,
|
||||||
FilterFun,
|
FilterFun,
|
||||||
Manifest),
|
Manifest),
|
||||||
{reply, ok, State#state{compaction_pending=true}}
|
{reply, {ok, Clerk}, State#state{compaction_pending=true}}
|
||||||
end;
|
end;
|
||||||
handle_call(compaction_pending, _From, State) ->
|
handle_call(compaction_pending, _From, State) ->
|
||||||
{reply, State#state.compaction_pending, State};
|
{reply, State#state.compaction_pending, State};
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
|
|
||||||
-include("include/leveled.hrl").
|
-include("include/leveled.hrl").
|
||||||
|
|
||||||
-define(MAX_SLOTS, 256).
|
-define(MAX_SLOTS, 2).
|
||||||
-define(LOOK_SLOTSIZE, 128). % Maximum of 128
|
-define(LOOK_SLOTSIZE, 128). % Maximum of 128
|
||||||
-define(LOOK_BLOCKSIZE, {24, 32}). % 4x + y = ?LOOK_SLOTSIZE
|
-define(LOOK_BLOCKSIZE, {24, 32}). % 4x + y = ?LOOK_SLOTSIZE
|
||||||
-define(NOLOOK_SLOTSIZE, 256).
|
-define(NOLOOK_SLOTSIZE, 256).
|
||||||
|
|
1263
test/leveledjc_eqc.erl
Normal file
1263
test/leveledjc_eqc.erl
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue