Skip to content

fix(aiokafka): keep Faust assignor for changelog tables; drop Python 3.9#682

Open
wbarnha wants to merge 4 commits into
masterfrom
claude/aiokafka-changelog-assignor
Open

fix(aiokafka): keep Faust assignor for changelog tables; drop Python 3.9#682
wbarnha wants to merge 4 commits into
masterfrom
claude/aiokafka-changelog-assignor

Conversation

@wbarnha

@wbarnha wbarnha commented Jul 17, 2026

Copy link
Copy Markdown
Member

Description

Rebases #676 (by @Mopsgeschwindigkeit / Marco Moser) onto current master. #676's branch could not be updated in place (external fork), so this re-applies its two commits — authorship preserved — on top of the merged #674/#677/#679/#680 work, where they apply cleanly and lint green.

Supersedes #676.

What's here (unchanged from #676)

  1. Keep the Faust assignor when changelog tables exist. Table recovery relies on app.assignor to map changelog active/standby partitions, but the worker consumer only used the Faust assignor when table_standby_replicas > 0. It now also stays enabled whenever the app has changelog tables:

    has_changelog_tables = bool(self.app.tables.changelog_topics)
    self._assignor = (
        self.app.assignor
        if self.app.conf.table_standby_replicas > 0 or has_changelog_tables
        else RoundRobinPartitionAssignor
    )

    Covered by two new unit tests (round-robin without tables; Faust assignor with changelog topics).

  2. aiokafka 0.13+ admin-request compatibility: MetadataRequest_v1MetadataRequest, and CreateTopicsRequest[protocol_version]CreateTopicsRequest.

  3. Drops Python 3.9 (and pypy3.9) support, bumping requires-python to >=3.10 across pyproject.toml/setup.py/tox.ini and the CI matrix. This is an intentional support-policy change.

Verification

Credit: original commits by Marco Moser (@Mopsgeschwindigkeit), smaxtec.


Generated by Claude Code

Marco Moser added 2 commits July 17, 2026 03:14
…min request compatibility

Ensure worker consumers use the Faust assignor whenever changelog tables are present,
even with zero standby replicas, so table recovery mapping remains correct. Also update
metadata/create-topics request construction for newer aiokafka APIs.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.06%. Comparing base (bb06adc) to head (28384bf).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #682      +/-   ##
==========================================
- Coverage   94.10%   94.06%   -0.04%     
==========================================
  Files         102      102              
  Lines       11107    11108       +1     
  Branches     1198     1198              
==========================================
- Hits        10452    10449       -3     
- Misses        556      558       +2     
- Partials       99      101       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

wbarnha added 2 commits July 17, 2026 22:01
The new MetadataRequest([]) / CreateTopicsRequest(...) forms require the
aiokafka 0.13.0 protocol refactor; on aiokafka < 0.13 MetadataRequest is a
versioned list (not callable) and CreateTopicsRequest must be indexed by
version. Faust keeps its aiokafka>=0.10 floor and already branches on
_AIOKAFKA_HAS_API_VERSION, so use the version-appropriate form at both
call sites instead of the new one unconditionally:

- _get_controller_node: MetadataRequest_v1([]) on <0.13, MetadataRequest([]) on >=0.13
- _really_create_topic: CreateTopicsRequest[1](...) on <0.13, CreateTopicsRequest(...) on >=0.13

This also fixes master's latent breakage where CreateTopicsRequest[version]
already fails on aiokafka 0.13+. Also drop a duplicate
_AIOKAFKA_HAS_API_VERSION definition introduced by the rebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant