Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mas 3.0 dialyzer #800

Merged
merged 8 commits into from
Oct 8, 2019
Merged

Mas 3.0 dialyzer #800

merged 8 commits into from
Oct 8, 2019

Conversation

martinsumner
Copy link
Contributor

Dialyzer fixes.

In gen_leader.erl the fix to dialyzer error on system_terminate/4 is clunky. It is not clear why system_terminate/4 had no return, and how moving the code around in this way means there is no no problem.

Rolled in for src/riak_repl2_fscoordinator.erl is a fix to the intermittently failing test #799. This had been incorrectly ignored in previous releases (given that it was accepted there were known problems in aae full-sync in these test cases) - but know following this fix has predictable (passing) behaviour

Work through dialyzer issues.  Should just be one unresolved issue left
Add logging of socket
Otherwise if the last partition is a soft_retry_limit failure will never report as complete with errors
maybe_complete_fullsync function requires further mocking
Dialyzer has an error if we call terminate from system_terminate - appears to be related to the exit/1 funciton within terminate.  This change brings a new function to log and return the reason for failure (previously part of terminate), so that the exit can happen in the parent function without causing a big DRY issue
src/gen_leader.erl Outdated Show resolved Hide resolved
{noreply, State4#state{error_exits = ErrorExits1,
purgatory = Purgatory,
dropped = Dropped}};
maybe_complete_fullsync(Running,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more than just a refactoring...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I was a bit lazy combining the two. Shall I revert out the commits associated with #799 and put in a separate PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reference. This is fine.

@@ -47,7 +47,7 @@
cluster,
fullsync_worker,
work_dir = undefined,
strategy :: keylist | aae,
strategy :: keylist | aae | undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation says:

%% If the protocol version >= 2.0, and the cluster has aae enabled and the replication
%% configuration stanza enables the aae strategy (the default is keylist),

In other words, it assumes a default. I would expect the init function to then implement that default by initialising the state with keylist alternatively to follow the logic.

At this moment there is a possible race condition when the server is started and a call legacy_status comes in, this may crash the server (line 107). Dializer seems not to spot this, though.

src/gen_leader.erl Outdated Show resolved Hide resolved
src/gen_leader.erl Outdated Show resolved Hide resolved
martinsumner and others added 2 commits October 8, 2019 12:59
Co-Authored-By: Thomas Arts <[email protected]>
Co-Authored-By: Thomas Arts <[email protected]>
@martinsumner martinsumner merged commit c2ecf77 into develop-3.0 Oct 8, 2019
@martinsumner martinsumner deleted the mas-3.0-dialyzer branch December 19, 2022 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants