Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] startMessageInclusive does not work for reader with chunk messages #461

Closed
2 tasks done
BewareMyPower opened this issue Dec 9, 2024 · 0 comments · Fixed by #462
Closed
2 tasks done

[Bug] startMessageInclusive does not work for reader with chunk messages #461

BewareMyPower opened this issue Dec 9, 2024 · 0 comments · Fixed by #462
Assignees

Comments

@BewareMyPower
Copy link
Contributor

Search before asking

  • I searched in the issues and found nothing similar.

Version

main branch (e264cf7)

Minimal reproduce step

Add the following test to tests/ReaderTest.cc:

TEST_F(ReaderSeekTest, testSeekInclusiveChunkMessage) {
    const auto topic = "test-seek-inclusive-chunk-message-" + std::to_string(time(nullptr));

    Producer producer;
    ProducerConfiguration producerConf;
    producerConf.setBatchingEnabled(false);
    producerConf.setChunkingEnabled(true);
    ASSERT_EQ(ResultOk, client.createProducer(topic, producerConf, producer));

    std::string largeValue(1024 * 1024 * 6, 'a');
    MessageId msgId;
    ASSERT_EQ(ResultOk, producer.send(MessageBuilder().setContent(largeValue).build(), msgId));
    ASSERT_EQ(ResultOk, producer.send(MessageBuilder().setContent(largeValue).build()));

    Reader reader;
    ReaderConfiguration readerConf;
    readerConf.setStartMessageIdInclusive(true);
    ASSERT_EQ(ResultOk, client.createReader(topic, msgId, readerConf, reader));

    Message msg;
    ASSERT_EQ(ResultOk, reader.readNext(msg, 3000));
    ASSERT_EQ(msgId, msg.getMessageId());
}

and run this test

What did you expect to see?

The test succeeds.

What did you see instead?

The test failed

pulsar-client-cpp/tests/ReaderTest.cc:912: Failure
Expected equality of these values:
  msgId
    Which is: (24,0,-1,-1);(24,1,-1,-1)
  msg.getMessageId()
    Which is: (24,2,-1,-1);(24,3,-1,-1)

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant