Marco Villalobos
07/08/2023, 2:30 AM0.my_sink_name_my_group_id__Committer.numRecordsIn = 343
0.my_sink_name_my_group_id__Writer.numRecordsIn = 0
The writer metric is always zero. Consequently, that topic never receives any messages.
In my functional Docker Compose deployment where Kafka messages are received the Writer metric is always positive non-zero.
Does anybody understand what Committer and Writer do, and what I should consider to resolve this issue?
This job uses three kafka topics. It uses AT_LEAST_ONCE delivery guarantee for Kafka, and EXACTLY_ONCE checkpointing.
1. kafka source
2. kafka sink for telegraf
3. kafka sink to statefun (but writing to that topic fails as described above).
This particular Kafka cluster is running with only two bootstrap servers (in case that makes a difference).Sharon Xie
07/10/2023, 5:22 AMMarco Villalobos
07/10/2023, 5:47 AMSharon Xie
07/12/2023, 10:53 PMMarco Villalobos
07/14/2023, 10:59 PMMarco Villalobos
07/14/2023, 11:16 PMSharon Xie
07/15/2023, 4:18 AMMarco Villalobos
07/15/2023, 6:16 AMfinal DataStream<StateFunRequest> stateFunStream = dataStream.flatMap(new MapTags())
.uid(Operators.MAP_TAGS.uid)
.name(Operators.MAP_TAGS.operatorName)
.keyBy(KeySelectors.keyByOrgAndUnitAndTagName())
.process(new InterceptIdentifiers())
.uid(Operators.INTERCEPT_INDENTIFERS.uid)
.name(Operators.INTERCEPT_INDENTIFERS.operatorName)
.keyBy(KeySelectors.keyByOrgAndUnitAndId())
.window(TumblingEventTimeWindows.of(Time.milliseconds(1)))
.process(new ReduceByIdentifiers())
.uid(Operators.REDUCE_BY_IDENTIFERS.uid)
.name(Operators.REDUCE_BY_IDENTIFERS.operatorName);
stateFunStream.sinkTo(stateFunIngress);Marco Villalobos
07/15/2023, 6:19 AMfinal DataStream<StateFunRequest> stateFunStream = dataStream.flatMap(new MapTags())
.uid(Operators.MAP_TAGS.uid)
.name(Operators.MAP_TAGS.operatorName)
.keyBy(KeySelectors.keyByOrgAndUnitAndTagName())
.process(new InterceptIdentifiers())
.uid(Operators.INTERCEPT_INDENTIFERS.uid)
.name(Operators.INTERCEPT_INDENTIFERS.operatorName)
.keyBy(KeySelectors.keyByOrgAndUnitAndId())
.window(TumblingEventTimeWindows.of(Time.milliseconds(1)))
.process(new ReduceByIdentifiers())
.setParallelism(1)
.uid(Operators.REDUCE_BY_IDENTIFERS.uid)
.name(Operators.REDUCE_BY_IDENTIFERS.operatorName);
stateFunStream.sinkTo(stateFunIngress);
However, I although I believe you are right, and that will solve the problem, I also think my solution should also work with parallelism greater than one.Marco Villalobos
07/15/2023, 6:26 AMSharon Xie
07/17/2023, 4:36 AM.setParallelism(1) after keyBy as my guess was the all keys get sent to the same TM because of the key skew. Window operator needs watermark and if there is no data, the watermark can't progress.Marco Villalobos
07/17/2023, 5:56 AM0.my_sink_name_my_group_id__Committer.numRecordsIn = 343
0.my_sink_name_my_group_id__Writer.numRecordsIn = 0
It’s committing but not writing.
However, I think your premise is wrong that all task managers need to receive data. I could be wrong, but my understanding is that if data keeps on arriving and there is data-skew then that introduces hot-spot related performance issues, but the ascending event time watermark will act like a string pulling time forward across all task managers. In fact, I have observed this behavior in other Flink jobs that have data-skew, and everything worked fine.
What do you think?Marco Villalobos
07/17/2023, 6:13 AMMarco Villalobos
07/21/2023, 5:32 PMfinal DataStream<Message> pipelineStream = streamEnv.fromSource(
kafkaSource,
WatermarkStrategy.<Message>forMonotonousTimestamps().withIdleness(Duration.ofSeconds(30)),
"pipeline-message-source"
);
After that, watermarks were generated and the Kafka sink started working as advertised. I picked 30 seconds because our Kafka source deliberate sends empty messages that serve as a ping to move event time forward when there is no real data to send. So, the longest our kafka source will be idle is 30 seconds.
Again, thank you for helping me.Sharon Xie
07/21/2023, 6:19 PM