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

Fix reip loading of riak_core #977

Merged
merged 1 commit into from
Jun 13, 2014
Merged

Fix reip loading of riak_core #977

merged 1 commit into from
Jun 13, 2014

Conversation

coderoshi
Copy link
Contributor

Fixes basho/riak#554, reip throwing an a badmatch when attempting to load riak_core, which was already loaded by cuttlefish.

@coderoshi coderoshi added this to the 2.0-RC milestone Jun 10, 2014
case application:load(riak_core) of
%% a process, such as cuttlefish, may have already loaded riak_core
{error,{already_loaded,riak_core}} -> ok;
ok -> ok

Choose a reason for hiding this comment

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

As I understand it, we can safely ignore {error, {already_loaded, riak_core}}. However, the application:load/1 function specifies {error, Reason }. How should {error, _} be handled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to allow any other error to just break and bubble to the surface. Adding the {error, _} case gives us two options: set ok and continue, which would just push the problem to line 225. Or, throw a different error, which is immediately caught by this function anyway.

Choose a reason for hiding this comment

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

@coderoshi seems reasonable to me. +1

@seancribbs
Copy link
Contributor

Wasn't there a decision to remove reip for 2.0? "cluster replace" does the same thing, but correctly.

@jonmeredith
Copy link
Contributor

We decided not to - the case it doesn't handle is a restore from backup
where you have no original nodes live and need to replace node names before
you can restart.

On Tue, Jun 10, 2014 at 10:18 PM, Sean Cribbs notifications@github.com
wrote:

Wasn't there a decision to remove reip for 2.0? "cluster replace" does the
same thing, but correctly.


Reply to this email directly or view it on GitHub
#977 (comment).

Jon Meredith
VP, Engineering
Basho Technologies, Inc.
jmeredith@basho.com

@jburwell jburwell self-assigned this Jun 10, 2014
@jcapricebasho
Copy link

@coderoshi When testing I noticed errors weren't bubbling up to the console. With reip being run when the node is down, the lager:error call in this catch won't be written: https://github.com/basho/riak_kv/blob/bug/er/reip-fix/src/riak_kv_console.erl#L236. Can this be changed to a single io:format, outputting the exception and reason, as part of this PR?

@coderoshi
Copy link
Contributor Author

Agreed @jcapricebasho. Also, rebased

@jcapricebasho
Copy link

Just for record, this is reproducible in at least 2.0.0beta6, which is where I found the issue. It can be reproduced by building a devrel, stopping a node, and attempting to run a riak-admin reip. Based on the most recent commit from Eric, the badmatch from ok = application:load(riak_core) actually returning {error, {already_loaded, riak_core}} is not visible in the console.

@jburwell
Copy link

Code looks good, and test passed on my laptop. +1.

@coderoshi
Copy link
Contributor Author

@jburwell want to +1 for bors? +1 574f42a

@jburwell
Copy link

+1 574f42a

Sorry for the n00b mistake.

borshop added a commit that referenced this pull request Jun 13, 2014
Fix reip loading of riak_core

Reviewed-by: jburwell
@coderoshi
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit 574f42a into develop Jun 13, 2014
@seancribbs seancribbs deleted the bug/er/reip-fix branch April 1, 2015 23:37
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.

riak-admin reip not working in riak-2.0.0beta6
6 participants