Skip to content

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR proposes to stop ReceiverTracker to close WriteAheadLog whenever it is and make WriteAheadLog and its implementations idempotent.

How was this patch tested?

Added a test in WriteAheadLogSuite. Note that the added test looks passing even if it closes twice (namely even without the changes in FileBasedWriteAheadLog and BatchedWriteAheadLog. It looks both are already idempotent but this is a rather sanity check.

@HyukjinKwon
Copy link
Member Author

cc @srowen and @zsxwing. Could you take a look and see if it makes sense?

@HyukjinKwon HyukjinKwon changed the title [SPARK-20935][STREAMING] Always close WriteAheadLog and make them idempotent [SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent Jun 7, 2017
@SparkQA
Copy link

SparkQA commented Jun 7, 2017

Test build #77792 has finished for PR 18224 at commit 44a67f3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 7, 2017

Test build #77793 has finished for PR 18224 at commit 9ef6dba.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

Choose a reason for hiding this comment

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

"It must be idempotent" or "It is required to be idempotent"

Copy link
Member

Choose a reason for hiding this comment

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

active might be simpler as an AtomicBoolean. Then I think you can just write if (!active.getAndSet(false)) return as the very first line.

Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be thread-safe? it seems like the impl just above tries to be. I don't know if it's needed.

Copy link
Member Author

@HyukjinKwon HyukjinKwon Jun 10, 2017

Choose a reason for hiding this comment

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

@srowen, maybe I missed your point. However, wouldn't there be a chance to try shutdown multiple times if isShutdown is not synchronised together? Probably, shutdown is idempotent itself but just wonder if it is okay to keep this as a safeguard.

@HyukjinKwon HyukjinKwon changed the title [SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent [WIP][SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent Jun 7, 2017
@HyukjinKwon HyukjinKwon changed the title [WIP][SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent [SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent Jun 10, 2017
@SparkQA
Copy link

SparkQA commented Jun 10, 2017

Test build #77875 has finished for PR 18224 at commit 76546c3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented Jun 11, 2017

Merged to master

@asfgit asfgit closed this in eb3ea3a Jun 11, 2017
dataknocker pushed a commit to dataknocker/spark that referenced this pull request Jun 16, 2017
…otent

## What changes were proposed in this pull request?

This PR proposes to stop `ReceiverTracker` to close `WriteAheadLog` whenever it is and make `WriteAheadLog` and its implementations idempotent.

## How was this patch tested?

Added a test in `WriteAheadLogSuite`. Note that  the added test looks passing even if it closes twice (namely even without the changes in `FileBasedWriteAheadLog` and `BatchedWriteAheadLog`. It looks both are already idempotent but this is a rather sanity check.

Author: hyukjinkwon <[email protected]>

Closes apache#18224 from HyukjinKwon/streaming-closing.
@HyukjinKwon HyukjinKwon deleted the streaming-closing branch January 2, 2018 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants