Skip to content

[Structured Streaming] Compact files in sink checkpoint location get bigger and bigger #2261

@sunspeedzy

Description

@sunspeedzy

There are some files with the suffix ".compact" in the sink folder of Spark checkpoint location.
The files compact all the history EsSinkStatus logs since the first index action.
Image

I found the reason is that org.elasticsearch.spark.sql.streaming.EsSinkMetadataLog#compactLogs() returns all the input logs rather than drops the expired ones.

override def compactLogs(logs: Seq[EsSinkStatus]): Seq[EsSinkStatus] = logs

I think it's better to add a code snippet which filter the logs and drop the expired ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions