Github user wangmiao1981 commented on a diff in the pull request: https://github.com/apache/spark/pull/14553#discussion_r75961808 --- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StreamExecution.scala --- @@ -244,6 +250,21 @@ class StreamExecution( logDebug(s"Resuming with committed offsets: $committedOffsets") } + // Compare the offsets we just read from the checkpoint against the + // sources' own checkpoint data. + val offsetChanges = mutable.Map[Source, Offset]() + committedOffsets.foreach { + case (src, checkptOffset) => + val srcOffset = src.getMinOffset + if (srcOffset.isDefined && srcOffset.get > checkptOffset) { + logWarning(s"Source $src lost offsets between $checkptOffset " + + s"and ${srcOffset.get} when resuming. Skipping ahead to ${srcOffset.get}.") + offsetChanges += (src -> srcOffset.get) + } + } + committedOffsets ++= offsetChanges + + --- End diff -- Extra blank line
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org