Github user dibbhatt commented on a diff in the pull request:
https://github.com/apache/spark/pull/6990#discussion_r33652324
--- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala
---
@@ -833,8 +833,10 @@ private[spark] class BlockManager(
logDebug("Put block %s locally took %s".format(blockId,
Utils.getUsedTimeMs(startTimeMs)))
// Either we're storing bytes and we asynchronously started
replication, or we're storing
- // values and need to serialize and replicate them now:
- if (putLevel.replication > 1) {
+ // values and need to serialize and replicate them now.
+ // Should not replicate the block if its StorageLevel is
StorageLevel.NONE or
+ // putting it to local is failed.
+ if (!putBlockInfo.isFailed && putLevel.replication > 1) {
--- End diff --
I agree with you @squito . What I have observed while working with Spark
Streaming is , there is a higher probability of getting the
BlockNotFoundException if I use MEMORY_ONLY settings and blocks got evicted
from memory. The MEMORY_ONLY_2 can help that to some extent as even if block
get dropped form one node, it still be available to other. This fix will help
to reduce the BlockNotFoundException while storing the Blocks to local ( and
failed ) , thus the Receiver gets the exception and can re-try again to store
at some point in future . If we allow block to replicate even if store to local
is failed, which is going to reduce the desired replication factor , Receiver
will not have any option to re-try . In case of Local store to success and
remote failed , or both local and remote store is success but eventually at
some point block got evicted is not at receiver's control. So out of three
possible cases ( Block failed locally but stored remotely , block stored
locally but failed
remotely , block stored both in remote and local but evicted sometime in
future ) , this fix can solve the BlockNotFoundException for 1/3 rd of the
cases by giving the Receiver to re-try to store the block once again to get
desired replication factor 2.
Do let me know if this argument is valid ?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]