-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][client]PIP-189: No batching if only one message in batch #16605
Conversation
0348e4a
to
97717fd
Compare
667710d
to
4e66d8d
Compare
559d42d
to
dc2fd44
Compare
/pulsarbot run-failure-checks |
3ff33cb
to
e119a97
Compare
8bdd2c2
to
bb70eb6
Compare
a74caf1
to
729553c
Compare
/pulsarbot run-failure-checks |
729553c
to
1c74f2a
Compare
pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
Show resolved
Hide resolved
pulsar-client-tools-test/src/test/java/org/apache/pulsar/client/cli/PulsarClientToolTest.java
Outdated
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageContainerImpl.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/BatchMessageContainerImpl.java
Show resolved
Hide resolved
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerEntryMetadataE2ETest.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are on your way.
Now the problem is to fix the remaining tests.
I wish to see this in 2.11 if possible, as it is a important behaviour change and it is better to not introduce it in a point release (like 2.11.1)
@codelipenghui @BewareMyPower @lhotari @michaeljmarshall @merlimat @rdhabalia
pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
Show resolved
Hide resolved
pulsar-client-tools/src/main/java/org/apache/pulsar/client/cli/CmdProduce.java
Outdated
Show resolved
Hide resolved
577a198
to
228cb2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…and apache#16605 - apache#17195 changed the method signature that apache#16605 depended upon
…pache#16605) [improve][client]PIP-189: No batching if only one message in batch apache#16605 ### Motivation * See apache#16619 ### Modifications * See apache#16619 * Most of the Modifications are relevant to `BatchMessageContainerImpl` * Of course there are some tests about batching need to be modified, because batched producer can also pubulish non-batched messages when this PIP applies. The tests include: * `RGUsageMTAggrWaitForAllMsgsTest` * `BatchMessageTest` * `BrokerEntryMetadataE2ETest` * `ClientDeduplicationTest` * `TopicReaderTest` * `PulsarClientToolTest`
…sors (#17273) * [fix][broker] Fix broken build caused by conflict between #17195 and #16605 - #17195 changed the method signature that #16605 depended upon * [fix][broker] Keep sorted list of cursors ordered by read position of active cursors when cacheEvictionByMarkDeletedPosition=false Fixes #16054 - calculate the sorted list of when a read position gets updated - this resolves #9958 in a proper way - #12045 broke the caching solution as explained in #16054 - remove invalid tests - fix tests - add more tests to handle corner cases * Address review comment * Handle durable & non-durable in the correct way * Fix cache tests since now entries get evicted reactively * Address review comment about method names * Change signature for add method so that position must be passed - this is more consistent with cursorUpdated method where the position is passed * Update javadoc for ManagedCursorContainer * Address review comment * Simplify ManagedCursorContainer * Clarify javadoc * Ensure that cursors are tracked by making sure that initial position isn't null unintentionally * Prevent race in updating activeCursors
…sors (#17273) * [fix][broker] Fix broken build caused by conflict between #17195 and #16605 - #17195 changed the method signature that #16605 depended upon * [fix][broker] Keep sorted list of cursors ordered by read position of active cursors when cacheEvictionByMarkDeletedPosition=false Fixes #16054 - calculate the sorted list of when a read position gets updated - this resolves #9958 in a proper way - #12045 broke the caching solution as explained in #16054 - remove invalid tests - fix tests - add more tests to handle corner cases * Address review comment * Handle durable & non-durable in the correct way * Fix cache tests since now entries get evicted reactively * Address review comment about method names * Change signature for add method so that position must be passed - this is more consistent with cursorUpdated method where the position is passed * Update javadoc for ManagedCursorContainer * Address review comment * Simplify ManagedCursorContainer * Clarify javadoc * Ensure that cursors are tracked by making sure that initial position isn't null unintentionally * Prevent race in updating activeCursors
…sors (#17273) * [fix][broker] Fix broken build caused by conflict between #17195 and #16605 - #17195 changed the method signature that #16605 depended upon * [fix][broker] Keep sorted list of cursors ordered by read position of active cursors when cacheEvictionByMarkDeletedPosition=false Fixes #16054 - calculate the sorted list of when a read position gets updated - this resolves #9958 in a proper way - #12045 broke the caching solution as explained in #16054 - remove invalid tests - fix tests - add more tests to handle corner cases * Address review comment * Handle durable & non-durable in the correct way * Fix cache tests since now entries get evicted reactively * Address review comment about method names * Change signature for add method so that position must be passed - this is more consistent with cursorUpdated method where the position is passed * Update javadoc for ManagedCursorContainer * Address review comment * Simplify ManagedCursorContainer * Clarify javadoc * Ensure that cursors are tracked by making sure that initial position isn't null unintentionally * Prevent race in updating activeCursors (cherry picked from commit 856ef15)
…pache#16605) [improve][client]PIP-189: No batching if only one message in batch apache#16605 ### Motivation * See apache#16619 ### Modifications * See apache#16619 * Most of the Modifications are relevant to `BatchMessageContainerImpl` * Of course there are some tests about batching need to be modified, because batched producer can also pubulish non-batched messages when this PIP applies. The tests include: * `RGUsageMTAggrWaitForAllMsgsTest` * `BatchMessageTest` * `BrokerEntryMetadataE2ETest` * `ClientDeduplicationTest` * `TopicReaderTest` * `PulsarClientToolTest`
move release/2.11.0 label to #18548 |
…sors (#17273) * [fix][broker] Fix broken build caused by conflict between #17195 and #16605 - #17195 changed the method signature that #16605 depended upon * [fix][broker] Keep sorted list of cursors ordered by read position of active cursors when cacheEvictionByMarkDeletedPosition=false Fixes #16054 - calculate the sorted list of when a read position gets updated - this resolves #9958 in a proper way - #12045 broke the caching solution as explained in #16054 - remove invalid tests - fix tests - add more tests to handle corner cases * Address review comment * Handle durable & non-durable in the correct way * Fix cache tests since now entries get evicted reactively * Address review comment about method names * Change signature for add method so that position must be passed - this is more consistent with cursorUpdated method where the position is passed * Update javadoc for ManagedCursorContainer * Address review comment * Simplify ManagedCursorContainer * Clarify javadoc * Ensure that cursors are tracked by making sure that initial position isn't null unintentionally * Prevent race in updating activeCursors (cherry picked from commit 856ef15)
### Motivation apache/pulsar#17696 removes the `powermock-reflect` dependency, which leads to a compilation error in KoP. ### Modifications Upgrade the Pulsar dependency to 2.11.0.0-rc5. Then replace `Whitebox.invokeMethod` with `MethodUtils.invokeMethod`. It also fixes the bug that null values are not handled well for non-batched messages. This bug was exposed because of [PIP-189](apache/pulsar#16605). ### TODO Migrate the bug fix for non-batched messages to branch-2.10.x and branch-2.9.x.
### Motivation apache/pulsar#17696 removes the `powermock-reflect` dependency, which leads to a compilation error in KoP. ### Modifications Upgrade the Pulsar dependency to 2.11.0.0-rc5. Then replace `Whitebox.invokeMethod` with `MethodUtils.invokeMethod`. It also fixes the bug that null values are not handled well for non-batched messages. This bug was exposed because of [PIP-189](apache/pulsar#16605).
### Motivation apache/pulsar#17696 removes the `powermock-reflect` dependency, which leads to a compilation error in KoP. ### Modifications Upgrade the Pulsar dependency to 2.11.0.0-rc5. Then replace `Whitebox.invokeMethod` with `MethodUtils.invokeMethod`. It also fixes the bug that null values are not handled well for non-batched messages. This bug was exposed because of [PIP-189](apache/pulsar#16605). (cherry picked from commit 88fe870)
### Motivation apache/pulsar#17696 removes the `powermock-reflect` dependency, which leads to a compilation error in KoP. ### Modifications Upgrade the Pulsar dependency to 2.11.0.0-rc5. Then replace `Whitebox.invokeMethod` with `MethodUtils.invokeMethod`. It also fixes the bug that null values are not handled well for non-batched messages. This bug was exposed because of [PIP-189](apache/pulsar#16605).
email discussion thread: https://lists.apache.org/thread/dbq1lrv03bhtk0lr5nwm5txo9ndjplv0
email VOTE thread: https://lists.apache.org/thread/s0wtqpoynh970xp6y08xhncyg93xqopv
Motivation
Modifications
BatchMessageContainerImpl
RGUsageMTAggrWaitForAllMsgsTest
BatchMessageTest
BrokerEntryMetadataE2ETest
ClientDeduplicationTest
TopicReaderTest
PulsarClientToolTest
Verifying this change
org.apache.pulsar.broker.service.BatchMessageTest#testBatchSendOneMessage
Documentation
doc-required
(Your PR needs to update docs and you will update later)
doc-not-needed
(Please explain why)
doc
(Your PR contains doc changes)
doc-complete
(Docs have been already added)