nsivabalan opened a new pull request, #7039: URL: https://github.com/apache/hudi/pull/7039
### Change Logs As of now, during completion of a write operation, we [unpersist all persisted Rdds](https://github.com/apache/hudi/blob/b78c3441c4e28200abec340eaff852375764cbdb/hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/client/SparkRDDWriteClient.java#L584) in the same sparkcontext. This could cause issues w/ async table services, metadata table etc. So, it needs to be fixed. Fix: We need a way to keep track of all persisted RDD ids for a given write operation and unpersist only those in the end. - Initially thought we can leverage JavaSparkContext.setEngineProperty, but looks like its applicable only for current thread. So multiple threads within the same process may not share the same properties. Apart from this, I could not locate any other mutable property that can be accessed from lower layers (action executors) and also by write clients, unless we change the all methods to take in extra argument and return extra argument. So, only viable option I can think of is introducing a static hashmap which can be accessed from anywhere. So, lower layer class like action executors will add entries to this hashmap. Key refers to table+commit time and value refers to comma separated list of persisted RDD Ids. During release resource call towards completion of a write, we can unpersist only those rdds which are part of the tracked entry in the hashmap. Deltastreamer unpersist: Since the WriteClient.releaseResources() already unpersist the rdds, unpersist call in DeltaSync is redundant and have removed it. WIP: Patch is a draft patch for now. Yet to fix tests. ### Impact _Describe any public API or user-facing feature change or any performance impact._ ### Risk level (write none, low medium or high below) _If medium or high, explain what verification was done to mitigate the risks._ ### Documentation Update _Describe any necessary documentation update if there is any new feature, config, or user-facing change_ - _The config description must be updated if new configs are added or the default value of the configs are changed_ - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make changes to the website._ ### Contributor's checklist - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute) - [ ] Change Logs and Impact were stated clearly - [ ] Adequate tests were added if applicable - [ ] CI passed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
