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/05/10 09:06:45 UTC

[GitHub] [pulsar] liangyepianzhou opened a new pull request, #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

liangyepianzhou opened a new pull request, #15524:
URL: https://github.com/apache/pulsar/pull/15524

   ### Motivation & Modification
   If transaction is not in the state of open, we should not allow it to ack message with in transaction. And the message should be redeliver again.
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes / no)
     - The public API: (yes / no)
     - The schema: (yes / no / don't know)
     - The default values of configurations: (yes / no)
     - The wire protocol: (yes / no)
     - The rest endpoints: (yes / no)
     - The admin cli options: (yes / no)
     - Anything that affects deployment: (yes / no / don't know)
   
   ### Documentation
   
   Check the box below or label this PR directly.
   
   Need to update docs? 
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `no-need-doc` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-added`
   (Docs have been already added)


-- 
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] liangyepianzhou commented on a diff in pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on code in PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#discussion_r869853269


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java:
##########
@@ -1052,13 +1052,16 @@ public void testTxnTimeOutInClient() throws Exception{
             Assert.assertTrue(e.getCause().getCause() instanceof TransactionCoordinatorClientException
                     .InvalidTxnStatusException);
         }
+        Message<String> message = null;
         try {
-            Message<String> message = consumer.receive();
+            message = consumer.receive();

Review Comment:
   Ci test will run for up to 30s, and an error will be reported if it times out. Of course, we cannot rely on this.



-- 
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] liangyepianzhou commented on a diff in pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on code in PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#discussion_r869853269


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java:
##########
@@ -1052,13 +1052,16 @@ public void testTxnTimeOutInClient() throws Exception{
             Assert.assertTrue(e.getCause().getCause() instanceof TransactionCoordinatorClientException
                     .InvalidTxnStatusException);
         }
+        Message<String> message = null;
         try {
-            Message<String> message = consumer.receive();
+            message = consumer.receive();

Review Comment:
   CI test will run for up to 30s, and an error will be reported if it times out. Of course, we cannot rely on this.



-- 
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] codelipenghui merged pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #15524:
URL: https://github.com/apache/pulsar/pull/15524


-- 
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] mattisonchao commented on a diff in pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
mattisonchao commented on code in PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#discussion_r869817668


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/TransactionEndToEndTest.java:
##########
@@ -1052,13 +1052,16 @@ public void testTxnTimeOutInClient() throws Exception{
             Assert.assertTrue(e.getCause().getCause() instanceof TransactionCoordinatorClientException
                     .InvalidTxnStatusException);
         }
+        Message<String> message = null;
         try {
-            Message<String> message = consumer.receive();
+            message = consumer.receive();

Review Comment:
   It feels like adding a timeout to the method avoids getting blocks all the time. But I'm not sure if we have another mechanism to guarantee that.



-- 
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] Technoboy- commented on pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
Technoboy- commented on PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#issuecomment-1123189261

   The test only tests for 1 consumer, and only tests redelivery. 
   What's the behavior when there are 2 or more consumers?


-- 
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] codelipenghui commented on pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#issuecomment-1126681552

   https://github.com/apache/pulsar/pull/15593 revert the PR, so don't need to cherry-pick to release branches


-- 
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] liangyepianzhou commented on pull request #15524: [Fix][Txn] Fix transaction redeliver message if ack failed

Posted by GitBox <gi...@apache.org>.
liangyepianzhou commented on PR #15524:
URL: https://github.com/apache/pulsar/pull/15524#issuecomment-1123207200

   > The test only tests for 1 consumer, and only tests redelivery. What's the behavior when there are 2 or more consumers?
   
   What we need to test is that it does call the `redeliverUnacknowledgedMessages` method. As for whether this method fully meets expectations, it should be tested by the PR that writes this method. For details, you can see the `ConsumerRedeliveryTest`, `DispatcherBlockConsumerTest` and `SimpleProducerConsumerTest


-- 
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