forked from basho/riak_core
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Github Actions Workflow (#81) * Added some specs and documentation to riak_core_ring (see #78) * Fix elvis problems (#83) * Erlang 24 support (#87) * Fixed fresh function (#89) * Bump v0.10.2 Co-authored-by: woelki <[email protected]>
- Loading branch information
Showing
74 changed files
with
12,021 additions
and
7,298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Erlang CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
erlang: [ 21,22,23,24 ] | ||
|
||
container: | ||
image: erlang:${{ matrix.erlang }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make compile | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
erlang: [ 21,22,23,24 ] | ||
|
||
container: | ||
image: erlang:${{ matrix.erlang }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make compile | ||
- run: make test | ||
- run: make proper | ||
- run: make coverage | ||
- name: Send Coverage | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./rebar3 as test coveralls send | ||
|
||
verify: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
erlang: [ 21,22,23,24 ] | ||
|
||
container: | ||
image: erlang:${{ matrix.erlang }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make format | ||
- run: make xref | ||
- run: make lint | ||
- run: make dialyzer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,5 +25,6 @@ rebar3.crashdump | |
.rebar3/ | ||
core_vnode_eqc.log | ||
.idea | ||
.vscode/ | ||
*.iml | ||
**/*.coverdata |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
%linting and style rules | ||
[{elvis, | ||
[{config, | ||
[#{dirs => ["apps/*/src", "src"], | ||
filter => "*.erl", | ||
rules => [{elvis_style, line_length, | ||
#{ignore => [], | ||
limit => 120, | ||
skip_comments => false}}, | ||
%{elvis_style, no_tabs}, | ||
{elvis_style, no_trailing_whitespace}, | ||
{elvis_style, macro_names, #{ignore => []}}, | ||
{elvis_style, macro_module_names}, | ||
{elvis_style, operator_spaces, #{rules => [{right, ","}, | ||
{right, "++"}, | ||
{left, "++"}, | ||
{right, "--"}, | ||
{left, "--"}]}}, | ||
%{elvis_style, god_modules, | ||
%#{limit => 40, | ||
% ignore => []}}, | ||
{elvis_style, used_ignored_variable}, | ||
{elvis_style, no_behavior_info}, | ||
{ | ||
elvis_style, | ||
module_naming_convention, | ||
#{regex => "^[a-z]([a-z0-9]*_?)*(_SUITE)?$", | ||
ignore => []} | ||
}, | ||
{ | ||
elvis_style, | ||
function_naming_convention, | ||
#{regex => "^[a-z]([a-z0-9]*_?)*$"} %base: ^([a-z][a-z0-9]*_?)*$ | ||
}, | ||
{elvis_style, state_record_and_type}, | ||
{elvis_style, no_spec_with_records} | ||
] | ||
}, | ||
#{dirs => ["."], | ||
filter => "Makefile", | ||
rules => [{elvis_project, no_deps_master_erlang_mk, #{ignore => []}}, | ||
{elvis_project, protocol_for_deps_erlang_mk, #{ignore => []}}] | ||
}, | ||
#{dirs => ["."], | ||
filter => "rebar.config", | ||
rules => [{elvis_project, no_deps_master_rebar, #{ignore => []}}, | ||
{elvis_project, protocol_for_deps_rebar, #{ignore => []}}] | ||
} | ||
] | ||
}] | ||
}]. | ||
[{config, | ||
[#{dirs => ["apps/*/src", "src"], filter => "*.erl", | ||
rules => | ||
[{elvis_text_style, | ||
line_length, | ||
#{limit => 120, skip_comments => false}}, | ||
%{elvis_text_style, no_tabs}, | ||
{elvis_text_style, no_trailing_whitespace}, | ||
{elvis_style, macro_names, #{ignore => []}}, | ||
{elvis_style, macro_module_names}, | ||
{elvis_style, | ||
operator_spaces, | ||
#{rules => | ||
[{right, ","}, | ||
{right, "++"}, | ||
{left, "++"}, | ||
{right, "--"}, | ||
{left, "--"}]}}, | ||
%{elvis_style, god_modules, | ||
%#{limit => 40, | ||
% ignore => []}}, | ||
{elvis_style, used_ignored_variable}, | ||
{elvis_style, no_behavior_info}, | ||
{elvis_style, | ||
module_naming_convention, | ||
#{regex => "^[a-z]([a-z0-9]*_?)*(_SUITE)?$", | ||
ignore => []}}, | ||
{elvis_style, | ||
function_naming_convention, | ||
#{regex => "^[a-z]([a-z0-9]*_?)*$"}}, | ||
%TODO add state() type | ||
%{elvis_style, state_record_and_type}, | ||
{elvis_style, no_spec_with_records}]}, | ||
#{dirs => ["."], filter => "Makefile", | ||
rules => | ||
[{elvis_project, | ||
no_deps_master_erlang_mk, | ||
#{ignore => []}}, | ||
{elvis_project, | ||
protocol_for_deps_erlang_mk, | ||
#{ignore => []}}]}, | ||
#{dirs => ["."], filter => "rebar.config", | ||
rules => | ||
[{elvis_project, no_deps_master_rebar, #{ignore => []}}, | ||
{elvis_project, | ||
protocol_for_deps_rebar, | ||
#{ignore => []}}]}]}]}] | ||
|
||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,62 @@ | ||
-type riak_core_handoff_dict() :: dict:dict(). | ||
|
||
-define(PT_MSG_INIT, 0). | ||
|
||
-define(PT_MSG_OBJ, 1). | ||
|
||
-define(PT_MSG_OLDSYNC, 2). | ||
|
||
-define(PT_MSG_SYNC, 3). | ||
|
||
-define(PT_MSG_CONFIGURE, 4). | ||
|
||
-define(PT_MSG_BATCH, 5). | ||
|
||
-define(PT_MSG_VERIFY_NODE, 6). | ||
|
||
-define(PT_MSG_UNKNOWN, 255). | ||
|
||
-record(ho_stats, | ||
{ | ||
interval_end :: erlang:timestamp(), | ||
last_update :: erlang:timestamp() | undefined, | ||
objs=0 :: non_neg_integer(), | ||
bytes=0 :: non_neg_integer() | ||
}). | ||
{interval_end :: erlang:timestamp(), | ||
last_update :: erlang:timestamp() | undefined, | ||
objs = 0 :: non_neg_integer(), | ||
bytes = 0 :: non_neg_integer()}). | ||
|
||
-type ho_stats() :: #ho_stats{}. | ||
|
||
-type ho_type() :: ownership | hinted | repair | resize. | ||
|
||
-type predicate() :: fun((any()) -> boolean()). | ||
|
||
-type index() :: chash:index_as_int(). | ||
-type mod_src_tgt() :: {module(), index(), index()} | {undefined, undefined, undefined}. | ||
|
||
-type mod_src_tgt() :: {module(), index(), index()} | | ||
{undefined, undefined, undefined}. | ||
|
||
-type mod_partition() :: {module(), index()}. | ||
|
||
-record(handoff_status, | ||
{ mod_src_tgt :: mod_src_tgt(), | ||
src_node :: node(), | ||
target_node :: node(), | ||
direction :: inbound | outbound, | ||
transport_pid :: pid(), | ||
transport_mon :: reference(), | ||
timestamp :: tuple(), | ||
status :: any(), | ||
stats :: riak_core_handoff_dict(), | ||
vnode_pid :: pid() | undefined, | ||
vnode_mon :: reference() | undefined, | ||
type :: ho_type() | undefined, | ||
req_origin :: node(), | ||
filter_mod_fun :: {module(), atom()} | undefined, | ||
size :: {function(), dynamic} | {non_neg_integer(), bytes | objects} | undefined | ||
}). | ||
{mod_src_tgt :: mod_src_tgt(), | ||
src_node :: node(), | ||
target_node :: node(), | ||
direction :: inbound | outbound, | ||
transport_pid :: pid(), | ||
transport_mon :: reference(), | ||
timestamp :: tuple(), | ||
status :: any(), | ||
stats :: riak_core_handoff_dict(), | ||
vnode_pid :: pid() | undefined, | ||
vnode_mon :: reference() | undefined, | ||
type :: ho_type() | undefined, | ||
req_origin :: node(), | ||
filter_mod_fun :: {module(), atom()} | undefined, | ||
size :: | ||
{function(), dynamic} | | ||
{non_neg_integer(), bytes | objects} | | ||
undefined}). | ||
|
||
-type handoff_status() :: #handoff_status{}. | ||
|
||
-type known_handoff() :: {{module(), index()}, | ||
{ho_type()|'delete', | ||
'inbound'|'outbound'|'local', | ||
node()|'$resize'|'$delete'}}. | ||
{ho_type() | delete, inbound | outbound | local, | ||
node() | '$resize' | '$delete'}}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,63 @@ | ||
-type sender_type() :: fsm | server | raw. | ||
-type sender() :: {sender_type(), reference() | tuple(), pid()} | | ||
%% TODO: Double-check that these special cases are kosher | ||
{fsm, undefined, pid()} | % what are these special cases and what is the reference used for?? | ||
{server, undefined, undefined} | % special case in riak_core_vnode_master.erl | ||
|
||
-type sender() :: {sender_type(), reference() | tuple(), | ||
pid()} | | ||
{fsm, undefined, pid()} | | ||
{server, undefined, undefined} | | ||
ignore. | ||
|
||
%% TODO: Double-check that these special cases are kosher | ||
|
||
% what are these special cases and what is the reference used for?? | ||
|
||
% special case in riak_core_vnode_master.erl | ||
|
||
-type partition() :: chash:index_as_int(). | ||
|
||
-type vnode_req() :: term(). | ||
|
||
-type keyspaces() :: [{partition(), [partition()]}]. | ||
|
||
-record(riak_vnode_req_v1, { | ||
index :: partition() | undefined, | ||
sender=ignore :: sender(), | ||
request :: vnode_req()}). | ||
|
||
-record(riak_coverage_req_v1, { | ||
index :: partition(), | ||
keyspaces :: keyspaces(), | ||
sender=ignore :: sender(), | ||
request :: vnode_req()}). | ||
|
||
-record(riak_core_fold_req_v1, { | ||
foldfun :: fun(), | ||
acc0 :: term()}). | ||
-record(riak_core_fold_req_v2, { | ||
foldfun :: fun(), | ||
acc0 :: term(), | ||
forwardable :: boolean(), | ||
opts = [] :: list()}). | ||
-record(riak_vnode_req_v1, | ||
{index :: partition() | undefined, | ||
sender = ignore :: sender(), | ||
request :: vnode_req()}). | ||
|
||
-record(riak_coverage_req_v1, | ||
{index :: partition(), | ||
keyspaces :: keyspaces(), | ||
sender = ignore :: sender(), | ||
request :: vnode_req()}). | ||
|
||
-record(riak_core_fold_req_v1, | ||
{foldfun :: fun(), acc0 :: term()}). | ||
|
||
-record(riak_core_fold_req_v2, | ||
{foldfun :: fun(), | ||
acc0 :: term(), | ||
forwardable :: boolean(), | ||
opts = [] :: list()}). | ||
|
||
-define(KV_VNODE_LOCK(Idx), {vnode_lock, Idx}). | ||
|
||
-type handoff_dest() :: {riak_core_handoff_manager:ho_type(), {partition(), node()}}. | ||
-type | ||
handoff_dest() :: {riak_core_handoff_manager:ho_type(), | ||
{partition(), node()}}. | ||
|
||
%% An integer, and the number of bits to shift it left to treat it as | ||
%% a mask in the 2^160 key space | ||
%% | ||
%% For a more thorough explanation of how these structures are used, | ||
%% see `riak_core_coverage_plan'. | ||
-type subpartition() :: { non_neg_integer(), pos_integer() }. | ||
-type subpartition() :: {non_neg_integer(), | ||
pos_integer()}. | ||
|
||
-record(vnode_coverage, { | ||
vnode_identifier = 0 :: non_neg_integer(), | ||
partition_filters = [] :: [non_neg_integer()], | ||
subpartition = undefined :: undefined | subpartition() | ||
}). | ||
-record(vnode_coverage, | ||
{vnode_identifier = 0 :: non_neg_integer(), | ||
partition_filters = [] :: [non_neg_integer()], | ||
subpartition = undefined :: | ||
undefined | subpartition()}). | ||
|
||
-type vnode_selector() :: all | allup. | ||
|
||
-type vnode_coverage() :: #vnode_coverage{}. |
Oops, something went wrong.