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/09/21 12:24:07 UTC

[GitHub] [pulsar] congbobo184 opened a new pull request, #17423: [improve][txn] Add getState in transaction for client API

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

   ### Motivation
   now `org.apache.pulsar.client.api.transaction.Transaction` dont have a interface for user to get the transaction state.
   
   user can get the transaction state to do user's own op.
   ### Modifications
   1. add the interface in `org.apache.pulsar.client.api.transaction.Transaction`     `getState`
   2. TransactionImpl implement the interface 
   ```
        * Get transaction state.
        *
        * @return {@link State} the state of the transaction.
        */
       State getState();
   ```
   ### Verifying this change
   add the test
   
   ### 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): (no)
     - The public API: (no)
     - The schema: (no)
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - The admin cli options: (no)
     - Anything that affects deployment: (no)
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   
   - [x] `doc-not-needed`
   


-- 
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] congbobo184 commented on a diff in pull request #17423: [improve][txn] Add getState in transaction for client API

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


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.

Review Comment:
   yes, `messages can be produced and acked with this transaction` more accurate



-- 
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 #17423: [improve][txn] Add getState in transaction for client API

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

   @nicoloboschi I see a transaction production user. They are using `TransactionImpl.checkIfOpen()` to do some checks when they using transactions. Otherwise, they can only do it by catching exceptions, but it's a bad experience. The ideal case is users don't need to care about the transaction state, just commit it or abort it. Always under some complex use cases, users depend on the state check (same as client.isConnected(); consumer.isConnected();)


-- 
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] Anonymitaet commented on a diff in pull request #17423: [improve][txn] Add getState in transaction for client API

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


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.

Review Comment:
   ```suggestion
            * When a transaction is in the `OPEN` state, it can commit or abort.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.

Review Comment:
   ```suggestion
            * When a client invokes a commit, the transaction state is changed from `OPEN` to `COMMITTING`.
   ```
   Do you mean this?



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.

Review Comment:
   ```suggestion
            * When a transaction is in the `OPEN` state, messages can be produced and acked with transactions.
   ```
   Do you mean this?



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.

Review Comment:
   ```suggestion
            * When a client invokes an abort, the transaction state is changed from `OPEN` to `ABORTING`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,

Review Comment:
   ```suggestion
            * When a client invokes a commit or an abort, but a transaction does not exist in a coordinator,
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.

Review Comment:
   ```suggestion
            * When a client receives a response to an abort, the transaction state is changed from `ABORTING` to `ABORTED`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.

Review Comment:
   ```suggestion
            * When a client receives a response to a commit, the transaction state is changed from `COMMITTING` to `COMMITTED`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the transaction state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in coordinator is committed or committing,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the transaction state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in coordinator is committed or committing,

Review Comment:
   ```suggestion
            * When a client invokes a commit, but the transaction state in a coordinator is `COMMITTED` or `COMMITTING`,
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in coordinator is aborted or aborting,
+         * the state will change to `ERROR`.

Review Comment:
   ```suggestion
            * then the state is changed to `ERROR`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in coordinator is aborted or aborting,
+         * the state will change to `ERROR`.
+         */
+        ERROR,
+
+        /**
+         * When the transaction timeout and the state is in `OPEN`, the state will change to `TIME_OUT` from `OPEN`.

Review Comment:
   ```suggestion
            * When a transaction is timed out and the transaction state is `OPEN`, then the transaction state is changed from `OPEN` to `TIME_OUT`.
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.

Review Comment:
   Write in the simple present tense as much as possible if you are covering facts that were, are, and forever shall be true. https://docs.google.com/document/d/1lc5j4RtuLIzlEYCBo97AC8-U_3Erzs_lxpkDuseU0n4/edit#bookmark=id.e8uqh1awkcnp



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,53 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+
+        /**
+         * When the transaction is in the `OPEN` state, it can produce with transaction and ack with the transaction.
+         *
+         * When the transaction is in the `OPEN` state, it can commit or abort.
+         */
+        OPEN,
+
+        /**
+         * When the client invokes commit, the state will change to `COMMITTING` from `OPEN`.
+         */
+        COMMITTING,
+
+        /**
+         * When the client invokes abort, the state will change to `ABORTING` from `OPEN`.
+         */
+        ABORTING,
+
+        /**
+         * When the client receives the response to the commit, the state will change to `COMMITTED` from `COMMITTING`.
+         */
+        COMMITTED,
+
+        /**
+         * When the client receives the response to the abort, the state will change to `ABORTED` from `ABORTING`.
+         */
+        ABORTED,
+
+        /**
+         * When the client invokes commit or abort but transaction not exist in coordinator,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes commit, but the transaction state in coordinator is committed or committing,
+         * the state will change to `ERROR`.
+         *
+         * When the client invokes abort, but the transaction state in coordinator is aborted or aborting,

Review Comment:
   ```suggestion
            * When a client invokes an abort, but the transaction state in a coordinator is `ABORTED` or `ABORTING`,
   ```



-- 
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 #17423: [improve][txn] Add getState in transaction for client API

Posted by "Technoboy- (via GitHub)" <gi...@apache.org>.
Technoboy- commented on PR #17423:
URL: https://github.com/apache/pulsar/pull/17423#issuecomment-1471809502

   Cherry-picked by #19834


-- 
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 a diff in pull request #17423: [improve][txn] Add getState in transaction for client API

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


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,16 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+        OPEN,
+        COMMITTING,
+        ABORTING,
+        COMMITTED,
+        ABORTED,
+        ERROR,
+        TIMEOUT

Review Comment:
   ```suggestion
           TIMED_OUT
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -48,4 +58,12 @@ public interface Transaction {
      *  @return {@link TxnID} the txnID.
      */
     TxnID getTxnID();
+
+    /**
+     * Get transaction state.
+     *
+     * @return {@link State} the state of the transaction.
+     */
+    State getTxnState();

Review Comment:
   ```suggestion
       State getState();
   ```



##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java:
##########
@@ -215,6 +205,11 @@ public TxnID getTxnID() {
         return new TxnID(txnIdMostBits, txnIdLeastBits);
     }
 
+    @Override
+    public State getTxnState() {

Review Comment:
   ```suggestion
       public State getState() {
   ```



##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,16 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+        OPEN,
+        COMMITTING,
+        ABORTING,
+        COMMITTED,
+        ABORTED,
+        ERROR,

Review Comment:
   It's better to add a document for `ERROR`
   Or can we rename it to `FAILED`?



-- 
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] congbobo184 merged pull request #17423: [improve][txn] Add getState in transaction for client API

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


-- 
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 #17423: [improve][txn] Add getState in transaction for client API

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

   @Anonymitaet Please help review the Java Doc


-- 
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] congbobo184 closed pull request #17423: [improve][txn] Add getState in transaction for client API

Posted by GitBox <gi...@apache.org>.
congbobo184 closed pull request #17423: [improve][txn] Add getState in transaction for client API
URL: https://github.com/apache/pulsar/pull/17423


-- 
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 #17423: [improve][txn] Add getState in transaction for client API

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

   I hope it can be cherry-picked to release branches from `branch-2.9`.
   So that users can use the new method to check the transaction state.
   And the change will not introduce risk 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] congbobo184 commented on pull request #17423: [improve][txn] Add getState in transaction for client API

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

   @Anonymitaet @codelipenghui I have fixed the comments, please review again. Thanks!  :)


-- 
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] congbobo184 commented on a diff in pull request #17423: [improve][txn] Add getState in transaction for client API

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


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/transaction/Transaction.java:
##########
@@ -29,6 +29,16 @@
 @InterfaceStability.Evolving
 public interface Transaction {
 
+    enum State {
+        OPEN,
+        COMMITTING,
+        ABORTING,
+        COMMITTED,
+        ABORTED,
+        ERROR,

Review Comment:
   `FAILED` can be retried. The three reasons for this state are not retrievable, so `ERROR` may be more accurate



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