xuanyuanking commented on a change in pull request #33870:
URL: https://github.com/apache/spark/pull/33870#discussion_r698968561



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/RocksDB.scala
##########
@@ -120,6 +120,9 @@ class RocksDB(
       if (conf.resetStatsOnLoad) {
         nativeStats.reset
       }
+      // reset resources to prevent side-effects from previous loaded version
+      prefixScanReuseIter.entrySet().asScala.foreach(_.getValue.close())
+      prefixScanReuseIter.clear()

Review comment:
       nit: How about wrap this 2 lines in a function 
`closePrefixScan(Reuse?)Iter()`? Since they are already been called in 3 places.




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to