Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,14 @@ object SQLConf {
.stringConf
.createWithDefault("lz4")

val CHECKPOINT_RENAMEDFILE_CHECK_ENABLED =
buildConf("spark.sql.streaming.checkpoint.renamedFileCheck.enabled")
.doc("When true, Spark will validate if renamed checkpoint file exists.")
.internal()
.version("3.4.0")
.booleanConf
.createWithDefault(false)

/**
* Note: this is defined in `RocksDBConf.FORMAT_VERSION`. These two places should be updated
* together.
Expand Down Expand Up @@ -4234,6 +4242,8 @@ class SQLConf extends Serializable with Logging {

def stateStoreCompressionCodec: String = getConf(STATE_STORE_COMPRESSION_CODEC)

def checkpointRenamedFileCheck: Boolean = getConf(CHECKPOINT_RENAMEDFILE_CHECK_ENABLED)

def parquetFilterPushDown: Boolean = getConf(PARQUET_FILTER_PUSHDOWN_ENABLED)

def parquetFilterPushDownDate: Boolean = getConf(PARQUET_FILTER_PUSHDOWN_DATE_ENABLED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@ object CheckpointFileManager extends Logging {
s"Failed to rename temp file $tempPath to $finalPath because file exists", fe)
if (!overwriteIfPossible) throw fe
}

// Optionally, check if the renamed file exists
if (SQLConf.get.checkpointRenamedFileCheck && !fm.exists(finalPath)) {
throw new IllegalStateException(s"Renamed temp file $tempPath to $finalPath. " +
s"But $finalPath does not exist.")
}

logInfo(s"Renamed temp file $tempPath to $finalPath")
} finally {
terminated = true
Expand Down