- 
                Notifications
    
You must be signed in to change notification settings  - Fork 28.9k
 
[SPARK-20935][STREAMING] Always close WriteAheadLog and make it idempotent #18224
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
Conversation
| 
           Test build #77792 has finished for PR 18224 at commit  
  | 
    
| 
           Test build #77793 has finished for PR 18224 at commit  
  | 
    
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.
"It must be idempotent" or "It is required to be idempotent"
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.
active might be simpler as an AtomicBoolean. Then I think you can just write if (!active.getAndSet(false)) return as the very first line.
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.
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.
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.
@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.
9ef6dba    to
    76546c3      
    Compare
  
    | 
           Test build #77875 has finished for PR 18224 at commit  
  | 
    
| 
           Merged to master  | 
    
…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.
What changes were proposed in this pull request?
This PR proposes to stop
ReceiverTrackerto closeWriteAheadLogwhenever it is and makeWriteAheadLogand 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 inFileBasedWriteAheadLogandBatchedWriteAheadLog. It looks both are already idempotent but this is a rather sanity check.