LeeeeLiu commented on a change in pull request #35513:
URL: https://github.com/apache/spark/pull/35513#discussion_r815709049
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecution.scala
##########
@@ -314,7 +314,27 @@ class MicroBatchExecution(
/* Initialize committed offsets to a committed batch, which at this
* is the second latest batch id in the offset log. */
if (latestBatchId != 0) {
+ /* SPARK-38033: In some unexpected cases, commit and offset are
inconsistent,
+ * and offset is not written into HDFS continuously, as follows:
+ *
+ * commits
+ * /tmp/streaming_xxxxxxxx/commits/113256
+ * /tmp/streaming_xxxxxxxx/commits/113257
+ * offsets
+ * /tmp/streaming_xxxxxxxx/offsets/113257
+ * /tmp/streaming_xxxxxxxx/offsets/113259
+ *
+ * When we start the streaming program, batch ${latestBatchId - 1}
is 113258,
+ * but offsets 113258 doesn't exist, an exception will be
thrown,resulting in
+ * the program cannot be started. As an improvement, we could
probably do some
+ * simply analysis and give better error message. */
val secondLatestOffsets = offsetLog.get(latestBatchId - 1).getOrElse
{
+ logError(s"Please check the checkpoint, batch ${latestBatchId - 1}
doesn't exist. " +
Review comment:
OK, I agree with you. Let me change it.
--
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]