HeartSaVioR commented on a change in pull request #18410: [SPARK-20971][SS]
purge metadata log in FileStreamSource
URL: https://github.com/apache/spark/pull/18410#discussion_r258358837
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FileStreamSource.scala
##########
@@ -256,8 +259,9 @@ class FileStreamSource(
* equal to `end` and will only request offsets greater than `end` in the
future.
*/
override def commit(end: Offset): Unit = {
- // No-op for now; FileStreamSource currently garbage-collects files based
on timestamp
- // and the value of the maxFileAge parameter.
+ if (currentLogOffset > minBatchesToRetain) {
+ metadataLog.purge(currentLogOffset - minBatchesToRetain)
Review comment:
HDFSMetadataLog is not aware of such configuration.
Btw, I've put my observation on `CompactibleFileStreamLog.purge()` in
comment on SPARK-20971.
https://issues.apache.org/jira/browse/SPARK-20971?focusedCommentId=16772632&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16772632
Let me quote it here:
> Btw, calling `purge` breaks CompactibleFileStreamLog since
CompactibleFileStreamLog expects non-compacted batches to be exist, but `purge`
just removes all of metadata files matching criteria. The safest way seems to
be just disallowing `purge` for CompactibleFileStreamLog, otherwise we have to
concern about the intention of calling `purge`, like I was curious of
rationalization of this issue like above.
So I've got a feeling that this may bring unexpected behavior and should be
avoided.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]