-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-12583][Mesos] Mesos shuffle service: Don't delete shuffle files before application has stopped #11272
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
Closed
bbossy
wants to merge
5
commits into
apache:master
from
bbossy:SPARK-12583-mesos-shuffle-service-heartbeat
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1118c8f
SPARK-12583: Heartbeat from MesosExternalShuffleClient to shuffle ser…
b33c227
SPARK-12583: Add missing license header
c632c6c
SPARK-12583: Addressing comments
2f6c0e6
SPARK-12583: Address comment: style
3a9914b
SPARK-12583: Address comments & rebase
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
53 changes: 53 additions & 0 deletions
53
...rc/main/java/org/apache/spark/network/shuffle/protocol/mesos/ShuffleServiceHeartbeat.java
This file contains hidden or 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,53 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package org.apache.spark.network.shuffle.protocol.mesos; | ||
|
|
||
| import io.netty.buffer.ByteBuf; | ||
| import org.apache.spark.network.protocol.Encoders; | ||
| import org.apache.spark.network.shuffle.protocol.BlockTransferMessage; | ||
|
|
||
| // Needed by ScalaDoc. See SPARK-7726 | ||
| import static org.apache.spark.network.shuffle.protocol.BlockTransferMessage.Type; | ||
|
|
||
| /** | ||
| * A heartbeat sent from the driver to the MesosExternalShuffleService. | ||
| */ | ||
| public class ShuffleServiceHeartbeat extends BlockTransferMessage { | ||
| private final String appId; | ||
|
|
||
| public ShuffleServiceHeartbeat(String appId) { | ||
| this.appId = appId; | ||
| } | ||
|
|
||
| public String getAppId() { return appId; } | ||
|
|
||
| @Override | ||
| protected Type type() { return Type.HEARTBEAT; } | ||
|
|
||
| @Override | ||
| public int encodedLength() { return Encoders.Strings.encodedLength(appId); } | ||
|
|
||
| @Override | ||
| public void encode(ByteBuf buf) { | ||
| Encoders.Strings.encode(buf, appId); | ||
| } | ||
|
|
||
| public static ShuffleServiceHeartbeat decode(ByteBuf buf) { | ||
| return new ShuffleServiceHeartbeat(Encoders.Strings.decode(buf)); | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I have a shuffle service running 1.6.0 and my Spark application is running 1.6.1? We'll get some kind of version error here right? Is the idea that this is OK since using shuffle service with Spark on Mesos in 1.6.0 is completely broken anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to do the backport for 1.6 in a separate PR, since what you mention here (compatibility of patched and unpatched spark versions) needs to be considered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. So, in the case of Shuffle Server with 1.6 and newer driver:
But, since Spark on Mesos in 1.6.0 is broken in this way, I would say this isn't a setup we should be very concerned with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, things work a bit better than I thought. The shuffle service will log errors like the one below, but the connection won't timeout anymore, since the driver is constantly sending (misunderstood) heartbeat messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO for 1.6: Need to handle that the RegisterDriver message might not contain the timeout value. The registration of the MesosShuffleClient with the ShuffleService should fail in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, this is the other way around: a newer shuffle service, and an older driver? That won't work, since
RegisterDriver.decodewould fail when trying to read the (non-existing) timeout value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbossy can you elaborate on your proposed fix for 1.6.2? How would it be different from this patch in its current form?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a quick look at this. What could be done is to send a more informative Throwable (using
callback.onFailure) when the driver registers with the shuffle service, but the message does not contain theheartbeatTimeoutMs.