Hi all Flink experts here, need some recommendatio...
# troubleshooting
s
Hi all Flink experts here, need some recommendations for working with large Kafka topics data and s3 data in Flink table api, this is what my transformation looks like
Copy code
insert into sink_table  (
    with source as (
        select
            *
        from streaming_source as t
        inner join some_table as v
            on t.datasource = v.datasource
            and t.host = v.host

        union all

        select
            *
        from s3_source as t
    )
    select
        ev.guid,
        source.*
    from some_other_table as ev
    inner join source
        on source.host = ev.host
        and source.datasource = ev.datasource
)
I see that during checkpointing, the taskmanager is running out of heap space
Copy code
Caused by: java.lang.OutOfMemoryError: Java heap space
or from jobmanager
Copy code
org.apache.flink.runtime.jobmaster.JobMasterException: TaskManager with id xyz is no longer reachable.
am I doing something wrong here? would appreciate some pointers
Copy code
Flink version: 1.18.1
streaming_source size: 100GB
s3_source size: 80 GB
instance used: i3en.xlarge
n
What does your task manager memory config look like? What format are you writing your data in? If you are writing to a Delta table then I have been in the same situation. My issues were Delta specific though afaik
👀 1
s
This is how the TM memory config looks like
I am writing data in JSON format
basically what I see is, gradually the Task heap memory goes upto ~ 100% and then either I get
Copy code
Flink - TimeoutException: Heartbeat of TaskManager with id someId timed out
or
Copy code
Caused by: java.lang.OutOfMemoryError: Java heap space
I am wondering is there a way to prevent Task Heap from filling up all the allocated memory
I have experimented with
Copy code
taskmanager.memory.managed.fraction
to either increase the heap size or decrease it, neither of them seems to have worked, the task heap still gets occupied fully
m
how are the sources defined? do they have timestamps? can the joins be temporal joins?
s
Copy code
streaming_source --> Kafka
some_table --> filesystem (s3)
some_other_table --> Kafka
source --> Kafka
The tables don’t have timestamps, would temporal joins be less expensive?
m
yes, as far as I understand doing join between 2 tables without timestamp will require loading both to memory, so you get OOM
If you can load the s3 data into some relational DB you can define it as lookup table, might help
s
I vaguely remember that,
streaming source
and
batch sources
affects
JVM heap
and
Manager memory
differently, does anyone remember, what/how that is?
n
basically what I see is, gradually the Task heap memory goes upto ~ 100% and then either I get
what do you mean "gradually"? Is it something like this:
☝️ so over a long period it starts creeping up? Or does it happen in shorter timeframes, so let's say within a few checkpoints?
s
even faster, like 40 minutes without even checkpoint
n
So I'm just trying to figure out what might be the issue, maybe I can help maybe not...
even faster, like 40 minutes without even checkpoint
A few questions: • what is your checkpoint interval? • what sink are you using?