You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/12/22 12:27:45 UTC

[GitHub] [pulsar-client-cpp] BewareMyPower opened a new pull request, #153: [fix] Fix MessageId serialization when it's a batched message

BewareMyPower opened a new pull request, #153:
URL: https://github.com/apache/pulsar-client-cpp/pull/153

   ### Motivation
   
   The serialization and deserialization of `MessageId` became wrong after https://github.com/apache/pulsar-client-cpp/pull/132.
   1. The batch size is not serialized.
   2. `BatchedMessageIdImpl` could never be deserialized.
   
   The wrong behaviors could lead to a result that all MessageId objects created from deserialization does not have a batch size, which might make `ReaderTest.testReaderOnSpecificMessageWithBatches` fail when the cmake build type is `Debug`. What's worse is that a MessageId created from deserialization is always treated as a `MessageIdImpl`, on which the acknowledgment will have wrong behavior.
   
   ### Modifications
   
   Serialize the batch size if it's valid. In deserialization, create a `BatchedMessageIdImpl` when the batch index and the batch size are valid as a batched message.
   
   There is a problem that if a `MessageId` is created from deserialization, it cannot share a `BatchMessageAcker` with other `MessageId` objects. In this case, create a fake `BatchMessageAcker` that returns false for both `ackIndividual` and `ackCumulative` methods. It will make acknowledgment always fail but will fall back to batch index ACK if batch index ACK is enabled.
   
   Add the `-DCMAKE_BUILD_TYPE=Debug` for tests to enable assertions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] RobertIndie merged pull request #153: [fix] Fix MessageId serialization when it's a batched message

Posted by GitBox <gi...@apache.org>.
RobertIndie merged PR #153:
URL: https://github.com/apache/pulsar-client-cpp/pull/153


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] BewareMyPower commented on pull request #153: [fix] Fix MessageId serialization when it's a batched message

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #153:
URL: https://github.com/apache/pulsar-client-cpp/pull/153#issuecomment-1363572861

   @shibd I see. I will fix it soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] BewareMyPower commented on pull request #153: [fix] Fix MessageId serialization when it's a batched message

Posted by GitBox <gi...@apache.org>.
BewareMyPower commented on PR #153:
URL: https://github.com/apache/pulsar-client-cpp/pull/153#issuecomment-1366278366

   @merlimat @RobertIndie @Demogorgon314 Could you take a second look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar-client-cpp] shibd commented on pull request #153: [fix] Fix MessageId serialization when it's a batched message

Posted by GitBox <gi...@apache.org>.
shibd commented on PR #153:
URL: https://github.com/apache/pulsar-client-cpp/pull/153#issuecomment-1363559609

   @BewareMyPower It seems that compilation does not pass in the macOS environment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org