Chia-Ping Tsai created KAFKA-21228:
--------------------------------------
Summary: The cold snapshot timer should check pending updates
instead of snapshot timestamps
Key: KAFKA-21228
URL: https://issues.apache.org/jira/browse/KAFKA-21228
Project: Kafka
Issue Type: Improvement
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
long coldSnapshottedPartitionsCount = shareStateMap.values().stream()
.filter(shareGroupOffset -> shareGroupOffset.createTimestamp() -
shareGroupOffset.writeTimestamp() != 0)
.count();
// If all share partitions are snapshotted, it means that
// system is quiet and cold snapshotting will not help much.
if (coldSnapshottedPartitionsCount == shareStateMap.size()) {
log.debug("All share snapshot records already cold snapshotted,
skipping.");
return new CoordinatorResult<>(List.of(), null);
}
The early return treats "all partitions cold-snapshotted" as "system is quiet".
But ShareUpdate does not touch createTimestamp or writeTimestamp (see merge()),
so once every partition has been cold-snapshotted, the timer returns early on
every run until some partition reaches the records threshold. Slow-traffic
partitions are never flushed, which conflicts with the purpose of the timer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)