Skip to content

Antalya 25.8 Backport of #113919 - Fix KafkaConsumersWithAssignment drifting negative - #2554

Merged
mkmkme merged 1 commit into
antalya-25.8from
backports/antalya-25.8/113919
Oct 13, 2026
Merged

mkmkme merged 1 commit into
antalya-25.8from
backports/antalya-25.8/113919

Conversation

@ilejn

@ilejn ilejn commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

The KafkaConsumersWithAssignment metric is decremented twice per rebalance revocation but incremented once per assignment, so it drifts down by one per rebalance and eventually reads negative.

The revocation callback in KafkaConsumer::createConsumer decrements the gauge directly, then calls cleanAssignment, which decrements it again. The assignment callback increments it once.

Measured on a 26.7.2.59 server up 39 hours with 8 Kafka tables:

Metric Value
KafkaConsumersWithAssignment -60
KafkaRebalanceAssignments 76
KafkaRebalanceRevocations 68

76 - 2 * 68 = -60. Per-table num_rebalance_assignments and num_rebalance_revocations in system.kafka_consumers sum to the same 76 and 68. KafkaAssignedPartitions is decremented only in cleanAssignment and read a correct 21 on the same server.

cleanAssignment is reached by every path that drops an assignment - the revocation callback, moveConsumer and the destructor - so removing the callback's own decrement leaves exactly one decrement per assignment dropped.

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Fix the KafkaConsumersWithAssignment metric drifting negative - it was decremented twice for every consumer group rebalance. (ClickHouse#113919 by @evillique)

Documentation entry for user-facing changes

...

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

…with-assignment-metric

Fix `KafkaConsumersWithAssignment` drifting negative

Signed-off-by: Ilya Golshtein <igolshtein@altinity.com>
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [670fe1d]

@ilejn ilejn added antalya backport Backport antalya-25.8 port-antalya PRs to be ported to all new Antalya releases labels Oct 12, 2026
@mkmkme
mkmkme merged commit a453817 into antalya-25.8 Oct 13, 2026
353 of 356 checks passed
@mkmkme mkmkme added the verified Approved for release label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

antalya antalya-25.8 antalya-25.8.33.20002 backport Backport port-antalya PRs to be ported to all new Antalya releases verified Approved for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants