Skip to content

[Bug] Incorrect last sequence id when sending messages in batch #531

Closed

Description

@BewareMyPower

Search before asking

  • I searched in the issues and found nothing similar.

Version

d040039

Minimal reproduce step

    for (int i = 0; i < 3; i++) {
        Message msg = MessageBuilder().setContent("content").build();
        producer.sendAsync(msg, nullptr);
    }
    producer.flush();
    LOG_INFO("sequence id: " << producer.getLastSequenceId())

What did you expect to see?

The output should be sequence id: 2 because the 3 messages' sequence ids are [0, 1, 2].

What did you see instead?

However, the result is sequence id: 4, if changing i < 3 to i < 5, the result becomes sequence id: 8, which means the sequence id is increased twice for each message in the batch.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added a commit that references this issue on Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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