zifeif2 commented on code in PR #52773:
URL: https://github.com/apache/spark/pull/52773#discussion_r2475148812


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/state/HDFSBackedStateStoreProvider.scala:
##########
@@ -475,9 +480,14 @@ private[sql] class HDFSBackedStateStoreProvider extends 
StateStoreProvider with
   private def commitUpdates(
       newVersion: Long,
       map: HDFSBackedStateStoreMap,
-      output: DataOutputStream): Unit = {
+      output: DataOutputStream,
+      saveAsSnapshot: Boolean = false): Unit = {
     synchronized {
-      finalizeDeltaFile(output)
+      if (saveAsSnapshot) {
+        writeSnapshotFile(newVersion, map, "commit")
+      } else {
+        finalizeDeltaFile(output)

Review Comment:
   @micheal-o Should I call `finalizeDeltaFile(output)` when saveAsSnapshot is 
true? 



##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBStateStoreSuite.scala:
##########
@@ -2595,6 +2595,21 @@ class RocksDBStateStoreSuite extends 
StateStoreSuiteBase[RocksDBStateStoreProvid
     }
   }
 
+  test("SPARK-54063: RocksDBStateStoreProvider should force snapshot on commit 
when lagging") {

Review Comment:
   will rename this test



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