GitHub user tdas opened a pull request:
https://github.com/apache/spark/pull/3026
[SPARK-4029][Streaming] Update streaming driver to reliably save and
recover received block metadata on driver failures
As part of the initiative of preventing data loss on driver failure, this
JIRA tracks the sub task of modifying the streaming driver to reliably save
received block metadata, and recover them on driver restart.
This was solved by introducing a `ReceivedBlockTracker` that takes all the
responsibility of managing the metadata of received blocks (i.e.
`ReceivedBlockInfo`, and any actions on them (e.g, allocating blocks to
batches, etc.). All actions to block info get written out to a write ahead log
(using `WriteAheadLogManager`). On recovery, all the actions are replaying to
recreate the pre-failure state of the `ReceivedBlockTracker`, which include the
batch-to-block allocations and the unallocated blocks.
Furthermore, the `ReceiverInputDStream` was modified to create
`WriteAheadLogBackedBlockRDD`s when file segment info is present in the
`ReceivedBlockInfo`. After recovery of all the block info (through recovery
`ReceivedBlockTracker`), the `WriteAheadLogBackedBlockRDD`s gets recreated with
the recovered info, and jobs submitted. The data of the blocks gets pulled from
the write ahead logs, thanks to the segment info present in the
`ReceivedBlockInfo`.
This is still a WIP. Things that are missing here are.
- Unit test that tests the driver recovery, by killing and restarting the
streaming context, and verifying all the input data gets processed.
- Cleaning up the received data write ahead log, by calling
`ReceivedBlockHandler.cleanupOldBlocks`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/tdas/spark driver-ha-rbt
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/3026.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3026
----
commit 7ae0a7fb1301a346921235bb4c661c92d71536f3
Author: Tathagata Das <[email protected]>
Date: 2014-10-30T22:41:13Z
Transferred changes from driver-ha-working branch
commit 25611d6c29dd4115fc17b4e36bffa33eaac8e2a6
Author: Tathagata Das <[email protected]>
Date: 2014-10-30T22:56:50Z
Minor changes before submitting PR
----
---
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]