kop
kop copied to clipboard
[BUG] Strange write frequency to the offset topic
Describe the bug
Following screenshots all represent the publish rate to the offset topic (__consumer_offsets), which represents the frequency to commit the offsets.
We can see there was a wave nearly every 6 hours.
Usually, the publish rate is stable.
During the wave, the publish rate increased with a constant speed.
Each local wave range is about 2 minutes.
To Reproduce
The same consumer subscribes the topic with the same group name, call commitSync method for each message. Consumers are closed and reopened every 2 minutes.
Expected behavior
We need to figure out whether the phenomenon is reasonable.
Analysis
It might due to the topic compaction. Currently, KoP only sets the compaction size with 100MB. But the compaction time is not configured.
@FieldContext(
category = CATEGORY_SERVER,
doc = "Interval between checks to see if topics with compaction policies need to be compacted"
)
private int brokerServiceCompactionMonitorIntervalInSeconds = 60;
The bug is that the metadata namespace's compaction threshold is never set after #448. Then every 60 seconds (brokerServiceCompactionMonitorIntervalInSeconds) the broker will perform compaction on this namespace.
With the previous implementation, the compaction is disabled when the compaction threshold is not set. So we need to investigate more about this issue.