sahnib commented on code in PR #45724:
URL: https://github.com/apache/spark/pull/45724#discussion_r1543883995
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -1919,6 +1927,35 @@ class RocksDBSuite extends
AlsoTestWithChangelogCheckpointingEnabled with Shared
}
}
+ testWithChangelogCheckpointingEnabled("time travel 4 -" +
+ " validate successful RocksDB load") {
+ val remoteDir = Utils.createTempDir().toString
+ val conf = dbConf.copy(minDeltasForSnapshot = 2, compactOnCommit = false)
+ new File(remoteDir).delete() // to make sure that the directory gets
created
+ withDB(remoteDir, conf = conf) { db =>
+ for (version <- 0 to 1) {
+ db.load(version)
+ db.put(version.toString, version.toString)
+ db.commit()
+ }
+
+ // load previous version, and recreate the snapshot
+ db.load(1)
+ db.put("3", "3")
+
+ // do maintenance - upload any latest snapshots so far
+ // would fail to acquire lock and no snapshots would be uploaded
+ db.doMaintenance()
+ db.commit()
+ // upload newly created snapshot 4.zip
+ db.doMaintenance()
+ }
+
+ // reload version 4 - should succeed
Review Comment:
Done
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/RocksDBSuite.scala:
##########
@@ -1919,6 +1927,35 @@ class RocksDBSuite extends
AlsoTestWithChangelogCheckpointingEnabled with Shared
}
}
+ testWithChangelogCheckpointingEnabled("time travel 4 -" +
+ " validate successful RocksDB load") {
+ val remoteDir = Utils.createTempDir().toString
+ val conf = dbConf.copy(minDeltasForSnapshot = 2, compactOnCommit = false)
+ new File(remoteDir).delete() // to make sure that the directory gets
created
+ withDB(remoteDir, conf = conf) { db =>
+ for (version <- 0 to 1) {
+ db.load(version)
+ db.put(version.toString, version.toString)
+ db.commit()
+ }
+
+ // load previous version, and recreate the snapshot
+ db.load(1)
+ db.put("3", "3")
+
+ // do maintenance - upload any latest snapshots so far
+ // would fail to acquire lock and no snapshots would be uploaded
+ db.doMaintenance()
+ db.commit()
+ // upload newly created snapshot 4.zip
Review Comment:
Done
--
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]