A negative lag value in CMAK (Cluster Manager for Apache Kafka) usually indicates a bug, timing issue, or inconsistency in how offsets are being calculated or reported. Here's a breakdown of what could cause it:
CMAK computes lag as:
ini
CopyEdit
lag = logEndOffset (latest offset) - consumerOffset (committed offset)
If the consumer offset is updated slightly after CMAK fetches the log end offset, but the values aren't synchronized properly, it can briefly show as negative.
kafka-consumer-groups.sh --reset-offsets
), CMAK may temporarily report negative lag.Some CMAK versions have known bugs or quirks related to lag calculation, especially under high load or with large offset ranges.
Check CMAK GitHub issues for related bugs (search "negative lag").
Lag calculations can become inconsistent if:
Topics are log-compacted
Partition leadership changes quickly
Consumer group rebalancing is in progress
Ensure consumers commit offsets properly and consistently
Upgrade CMAK – bugs are often fixed in newer versions
Check broker and CMAK server clocks – sync them using NTP
Monitor offset commits and topic configurations
Restart CMAK – sometimes a stale cache can cause issues
Would you like a script or a dashboard tip to track offsets outside of CMAK as a comparison tool?