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

Make peer recovery send file chunks async #44468

Merged
merged 2 commits into from
Jul 17, 2019
Merged

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Jul 17, 2019

This PR reintroduces #44040 with an additional commit fixing the notify once assertion. We can call MultiFileTransfer#onComplete twice if the recovery is canceled during the clean_files step.

  1. Send_files step calls MultiFileTransfer#onComplete(null) to start the clean_files step

  2. Clean_files sends and receives a response before the method returns. The response notifies the phase 1 listener (either success or failure).

  3. Before returning, the clean_files method checkForCancel and throws an exception as the recovery was canceled. This causes the send_files listener to notify the phase1 listener. However, the phase1 listener was notified in step 2 already. The phase1 listener must be notified at most once as it delegates to ListenerFuture.

The new commit allows StepListener to be notified multiple times.

Relates #44040
Relates #36195

@dnhatn dnhatn added >enhancement :Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. v8.0.0 v7.4.0 labels Jul 17, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@dnhatn
Copy link
Member Author

dnhatn commented Jul 17, 2019

@ywelsch @original-brownbear Please review the additional commit: 738ab4e.

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

@dnhatn
Copy link
Member Author

dnhatn commented Jul 17, 2019

Thanks Yannick.

@dnhatn dnhatn merged commit 34f65c6 into elastic:master Jul 17, 2019
@dnhatn dnhatn deleted the send-chunks branch July 17, 2019 12:17
dnhatn added a commit that referenced this pull request Jul 18, 2019
dnhatn added a commit that referenced this pull request Oct 22, 2019
dnhatn added a commit that referenced this pull request Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Recovery Anything around constructing a new shard, either from a local or a remote source. >enhancement v7.4.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants