Skip to content

mqtt-kafka: reset the group offsets on Clean Start when publish.qos.max is below 2 #3205

Closed

Description

@jfallows

Description

On Clean Start=1 the session deletes the committed offsets of the consumer group <groupIdPrefix>-<clientId> before the new session is established (#3170, second part, #3202). It runs on the path that already fetches the topic partitions, which is taken when publish.qos.max is 2 (the default).

For a binding with publish.qos.max below 2 the session never fetches the partitions, so the reset does not run: OffsetDelete needs the partitions to name. A client on such a binding that connects with Clean Start=1 is still sent the backlog of its previous session. Four existing Clean Start scenarios run on that path.

Specification statements

Read in the full OASIS texts before designing or testing:

  • v5.0 3.1.2.4 [MQTT-3.1.2-4]: Clean Start=1 means the Server MUST discard any existing Session and start a new Session.
  • v3.1.1 3.1.2.4 [MQTT-3.1.2-6]: CleanSession=1 means the Server MUST discard any previous Session, and its state data MUST NOT be reused in any subsequent Session.
  • v5.0 4.1: the Session State includes QoS 1 and QoS 2 messages sent but not completely acknowledged and those pending transmission; here that state is the group offsets.

Gap

The discard obligation does not depend on the publish.qos.max setting, so a Clean Start must reset the group offsets on this path as well.

Approach to settle

Fetch the partitions of the messages and retained topics on Clean Start when publish.qos.max is below 2, then run the same FindCoordinator and OffsetDelete exchange as the QoS 2 path, with the same failure handling (not retried, never fails the connect). Check whether the fetch changes the order of the begin reply to the client on this path.

Acceptance

  • Scripts and ITs first: the four existing Clean Start scenarios on this path expect the meta streams, FindCoordinator and OffsetDelete, and fail against the current code.
  • The group offsets are deleted on Clean Start for publish.qos.max below 2.

Related: #3170, #3202.

Activity

  1. self-assigned this
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions