kop icon indicating copy to clipboard operation
kop copied to clipboard

[BUG] Strange write frequency to the offset topic

Open BewareMyPower opened this issue 3 years ago • 2 comments

Describe the bug

Following screenshots all represent the publish rate to the offset topic (__consumer_offsets), which represents the frequency to commit the offsets.

image

We can see there was a wave nearly every 6 hours.


image

Usually, the publish rate is stable.


image

During the wave, the publish rate increased with a constant speed.


image

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;

BewareMyPower avatar May 06 '22 16:05 BewareMyPower

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.

BewareMyPower avatar May 06 '22 18:05 BewareMyPower

With the previous implementation, the compaction is disabled when the compaction threshold is not set. So we need to investigate more about this issue.

BewareMyPower avatar May 09 '22 05:05 BewareMyPower