Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-38670][SS] Add offset commit time to streaming query listener #35985

Closed
wants to merge 2 commits into from
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 @@ -672,9 +672,11 @@ class MicroBatchExecution(
withProgressLocked {
sinkCommitProgress = batchSinkProgress
watermarkTracker.updateWatermark(lastExecution.executedPlan)
assert(commitLog.add(currentBatchId, CommitMetadata(watermarkTracker.currentWatermark)),
"Concurrent update to the commit log. Multiple streaming jobs detected for " +
s"$currentBatchId")
reportTimeTaken("commitOffsets") {
assert(commitLog.add(currentBatchId, CommitMetadata(watermarkTracker.currentWatermark)),
"Concurrent update to the commit log. Multiple streaming jobs detected for " +
s"$currentBatchId")
}
committedOffsets ++= availableOffsets
}
logDebug(s"Completed batch ${currentBatchId}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
assert(query.recentProgress.last.eq(query.lastProgress))

val progress = query.lastProgress

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unnecessary change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will revert

assert(progress.id === query.id)
assert(progress.name === query.name)
assert(progress.batchId === 0)
Expand All @@ -326,6 +327,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi
assert(progress.durationMs.get("latestOffset") === 50)
assert(progress.durationMs.get("queryPlanning") === 100)
assert(progress.durationMs.get("walCommit") === 0)
assert(progress.durationMs.get("commitOffsets") === 0)
assert(progress.durationMs.get("addBatch") === 350)
assert(progress.durationMs.get("triggerExecution") === 500)

Expand Down