Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
only writing out metadatas for new runId
  • Loading branch information
ericm-db committed Jun 10, 2024
commit be7f2d0418a0dee6802138702c01f4caf90b8fd1
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,19 @@ class MicroBatchExecution(
if (!commitLog.add(execCtx.batchId, CommitMetadata(watermarkTracker.currentWatermark))) {
throw QueryExecutionErrors.concurrentStreamLogUpdate(execCtx.batchId)
}
execCtx.executionPlan.executedPlan.collect {
case s: StateStoreWriter =>
val metadata = s.operatorStateMetadata()
val id = metadata.operatorInfo.operatorId
val metadataFile = operatorStateMetadataLogs(id)
if (!metadataFile.add(execCtx.batchId, metadata)) {
throw QueryExecutionErrors.concurrentStreamLogUpdate(execCtx.batchId)
}
val shouldWriteMetadatas = execCtx.previousContext.isEmpty ||
execCtx.previousContext.get.executionPlan.runId != execCtx.executionPlan.runId
if (shouldWriteMetadatas) {
logError("writing out metadatas")
execCtx.executionPlan.executedPlan.collect {
case s: StateStoreWriter =>
val metadata = s.operatorStateMetadata()
val id = metadata.operatorInfo.operatorId
val metadataFile = operatorStateMetadataLogs(id)
if (!metadataFile.add(execCtx.batchId, metadata)) {
throw QueryExecutionErrors.concurrentStreamLogUpdate(execCtx.batchId)
}
}
}
}
committedOffsets ++= execCtx.endOffsets
Expand Down