You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2019/12/28 16:19:15 UTC

[GitHub] [servicecomb-pack] coolbeevip opened a new pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation

coolbeevip opened a new pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626
 
 
   Add attribute `mode` to the @Compensable annotation, which contains three options:
   
   - forward 
   - reverse (default)
   - combine (first forward then reverse)

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] WillemJiang merged pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation

Posted by GitBox <gi...@apache.org>.
WillemJiang merged pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] coveralls commented on issue #626: [SCB-1695] Add attribute mode to @Compensable annotation

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #626: [SCB-1695] Add attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626#issuecomment-569432607
 
 
   
   [![Coverage Status](https://coveralls.io/builds/27826806/badge)](https://coveralls.io/builds/27826806)
   
   Coverage decreased (-0.02%) to 80.912% when pulling **ed95e05f6c82f5f6b7a11d2eb6b732c1b0f48501 on coolbeevip:SCB-1695** into **b9fb63435650099ee5a55f3bd785d8f2c33a410a on apache:master**.
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] coolbeevip commented on a change in pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation

Posted by GitBox <gi...@apache.org>.
coolbeevip commented on a change in pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626#discussion_r361838352
 
 

 ##########
 File path: omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/RecoveryPolicyFactory.java
 ##########
 @@ -17,17 +17,19 @@
 
 package org.apache.servicecomb.pack.omega.transaction;
 
+import org.apache.servicecomb.pack.omega.transaction.annotations.CompensableMode;
+
 public class RecoveryPolicyFactory {
   private static final RecoveryPolicy DEFAULT_RECOVERY = new DefaultRecovery();
 
   private static final RecoveryPolicy FORWARD_RECOVERY = new ForwardRecovery();
 
   /**
-   * If retries == 0, use the default recovery to execute only once.
-   * If retries > 0, it will use the forward recovery and retry the given times at most.
-   * If retries == -1, it will use the forward recovery and retry forever until interrupted.
+   * If mode is reverse, it will use the reverse recovery
+   * If mode is forward, it will use the forward recovery
+   * If mode is combine, it will use the first forward then reverse
    */
-  static RecoveryPolicy getRecoveryPolicy(int retries) {
-    return retries != 0 ? FORWARD_RECOVERY : DEFAULT_RECOVERY;
+  static RecoveryPolicy getRecoveryPolicy(CompensableMode mode) {
 
 Review comment:
   The combine mode is not implemented, because the TxAbortEvent event is not sent to alpha after the forward compensation, I will be in another PR implemente combine mode

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-pack] WillemJiang commented on a change in pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation

Posted by GitBox <gi...@apache.org>.
WillemJiang commented on a change in pull request #626: [SCB-1695] Add attribute mode to @Compensable annotation
URL: https://github.com/apache/servicecomb-pack/pull/626#discussion_r361831284
 
 

 ##########
 File path: omega/omega-transaction/src/main/java/org/apache/servicecomb/pack/omega/transaction/RecoveryPolicyFactory.java
 ##########
 @@ -17,17 +17,19 @@
 
 package org.apache.servicecomb.pack.omega.transaction;
 
+import org.apache.servicecomb.pack.omega.transaction.annotations.CompensableMode;
+
 public class RecoveryPolicyFactory {
   private static final RecoveryPolicy DEFAULT_RECOVERY = new DefaultRecovery();
 
   private static final RecoveryPolicy FORWARD_RECOVERY = new ForwardRecovery();
 
   /**
-   * If retries == 0, use the default recovery to execute only once.
-   * If retries > 0, it will use the forward recovery and retry the given times at most.
-   * If retries == -1, it will use the forward recovery and retry forever until interrupted.
+   * If mode is reverse, it will use the reverse recovery
+   * If mode is forward, it will use the forward recovery
+   * If mode is combine, it will use the first forward then reverse
    */
-  static RecoveryPolicy getRecoveryPolicy(int retries) {
-    return retries != 0 ? FORWARD_RECOVERY : DEFAULT_RECOVERY;
+  static RecoveryPolicy getRecoveryPolicy(CompensableMode mode) {
 
 Review comment:
   I doubt if we already implement the combine mode.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services