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

Allow handoff sender to abort handoff by throw'ing from fold fun #626

Merged
merged 1 commit into from Sep 15, 2014

Conversation

macintux
Copy link
Contributor

(Supersedes #553, cherry picked from @slfritchie's bugfix/handoff-fold-abort-early-2.0)

There's no reason why the handoff sender fold fun has to continue
folding when there's a TCP error. Instead, throw the #ho_acc{}
record with its error={error,Reason} field intact.

If we force the handoff receiver to exit (using exit(HO_pid, kill)),
then we simply see the following logged on the sender side:

2014-03-17 15:53:30.949 [error] <0.27207.2>@riak_core_handoff_sender:start_fold:266 hinted_handoff transfer of riak_kv_vnode from 'dev1@127.0.0.1' 1415829711164312202009819681693899175291684651008 to 'dev2@127.0.0.1' 1415829711164312202009819681693899175291684651008 failed because of closed
2014-03-17 15:53:30.950 [error] <0.220.0>@riak_core_handoff_manager:handle_info:289 An outbound handoff of partition riak_kv_vnode 1415829711164312202009819681693899175291684651008 was terminated for reason: {shutdown,{error,closed}}

Also, change the lager:info() message when the handoff receiver
gets a tcp_error message that includes the reason and
distiguishes itself from other handoff receiver log messages.

Also, one whitespace correction.

There's no reason why the handoff sender fold fun has to continue
folding when there's a TCP error.  Instead, throw the #ho_acc{}
record with its error={error,Reason} field intact.

If we force the handoff receiver to exit (using exit(HO_pid, kill)),
then we simply see the following logged on the sender side:

    2014-03-17 15:53:30.949 [error] <0.27207.2>@riak_core_handoff_sender:start_fold:266 hinted_handoff transfer of riak_kv_vnode from 'dev1@127.0.0.1' 1415829711164312202009819681693899175291684651008 to 'dev2@127.0.0.1' 1415829711164312202009819681693899175291684651008 failed because of closed
    2014-03-17 15:53:30.950 [error] <0.220.0>@riak_core_handoff_manager:handle_info:289 An outbound handoff of partition riak_kv_vnode 1415829711164312202009819681693899175291684651008 was terminated for reason: {shutdown,{error,closed}}

Also, change the lager:info() message when the handoff receiver
gets a tcp_error message that *includes* the reason and
distiguishes itself from other handoff receiver log messages.

Also, one whitespace correction.
@andrewjstone
Copy link
Contributor

👍 8620dcc
@macintux's review looks thorough and the commit merged cleanly and builds. Let bors run the tests ;)

borshop added a commit that referenced this pull request Sep 15, 2014
…rt-early-2.0

Allow handoff sender to abort handoff by throw'ing from fold fun

Reviewed-by: andrewjstone
@macintux
Copy link
Contributor Author

@borshop merge

@borshop borshop merged commit 8620dcc into 2.0 Sep 15, 2014
@macintux macintux deleted the bugfix/cherrypick/handoff-fold-abort-early-2.0 branch September 15, 2014 19:00
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.

None yet

4 participants