You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by Tagar <gi...@git.apache.org> on 2017/01/03 02:54:37 UTC

[GitHub] spark pull request #15923: [SPARK-4105] retry the fetch or stage if shuffle ...

Github user Tagar commented on a diff in the pull request:

    https://github.com/apache/spark/pull/15923#discussion_r94356127
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala ---
    @@ -305,40 +316,84 @@ final class ShuffleBlockFetcherIterator(
        */
       override def next(): (BlockId, InputStream) = {
         numBlocksProcessed += 1
    -    val startFetchWait = System.currentTimeMillis()
    -    currentResult = results.take()
    -    val result = currentResult
    -    val stopFetchWait = System.currentTimeMillis()
    -    shuffleMetrics.incFetchWaitTime(stopFetchWait - startFetchWait)
    -
    -    result match {
    -      case SuccessFetchResult(_, address, size, buf, isNetworkReqDone) =>
    -        if (address != blockManager.blockManagerId) {
    -          shuffleMetrics.incRemoteBytesRead(buf.size)
    -          shuffleMetrics.incRemoteBlocksFetched(1)
    -        }
    -        bytesInFlight -= size
    -        if (isNetworkReqDone) {
    -          reqsInFlight -= 1
    -          logDebug("Number of requests in flight " + reqsInFlight)
    -        }
    -      case _ =>
    -    }
    -    // Send fetch requests up to maxBytesInFlight
    -    fetchUpToMaxBytes()
     
    -    result match {
    -      case FailureFetchResult(blockId, address, e) =>
    -        throwFetchFailedException(blockId, address, e)
    +    var result: FetchResult = null
    +    var input: InputStream = null
    +    // Take the next fetched result and try to decompress it to detect data corruption,
    +    // then fetch it one more time if it's corrupt, throw FailureFetchResult if the second fetch
    --- End diff --
    
    Is netty/shuffle data being compressed using Snappy algorithm by default? If so, might be good to idea to enable checksum checking at Netty level too?
    
    https://netty.io/4.0/api/io/netty/handler/codec/compression/SnappyFramedDecoder.html
    
    > Note that by default, validation of the checksum header in each chunk is DISABLED for performance improvements. If performance is less of an issue, or if you would prefer the safety that checksum validation brings, please use the SnappyFramedDecoder(boolean) constructor with the argument set to true.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org