-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
add time limit when transaction retry on the server #824
Conversation
merge for name change
Codecov Report
@@ Coverage Diff @@
## develop #824 +/- ##
=============================================
- Coverage 39.6% 39.44% -0.16%
Complexity 1138 1138
=============================================
Files 221 222 +1
Lines 8828 8872 +44
Branches 1130 1143 +13
=============================================
+ Hits 3496 3500 +4
- Misses 4891 4931 +40
Partials 441 441
Continue to review full report at Codecov.
|
} | ||
} | ||
|
||
public static void main(String[] args) { |
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.
remove the main method?use test case。
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.
OK
Plz add new config items to the nacos-config.txt too . |
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
OK. |
I have a mind. It shoud be retry all the time until the rollback get success, this is the guarantee of final-consistency(BASE). So is it necessary for this PR ? |
@XCXCXCXCX @zhangthen This requirement is what I proposed. The default should be a permanent retry. When a database downtime or a single-point application fails to start, you need to stop retrying. |
If retry stop, how to make the transaction to be final consistency ? |
If the physical failure of the database hangs, it is known that it cannot be started, and how to ensure consistency. |
If retry stop, how to make the transaction to be final consistency ? I think it shoud allways retry, even if database down or application fails , unless there is a manual intervention to make the transaction to be final consistency, not stop retry automatically, must stop by manual-intervention. In addition , without manual judgment, how to know the cause of failure, it is too hasty to stop retrying automatically after several failures. |
This value defaults to permanent retry. When the user determines that this cannot be recovered because of a physical failure, the user can stop the retry by configuring this value. |
I have a suggest, the retry provides a configuration,it is up to the user to decide whether to retry permanently. |
|
I think this implementation is too simple, will affect the rollback of all transactions; |
@zhangthen @slievrly |
I agree this solution. |
yes, i think use time wheel and Exponential Backoff is better for retry |
config/seata-config-core/src/main/java/io/seata/config/AbstractConfiguration.java
Show resolved
Hide resolved
@zhangthen Currently configured for permanent retry, this modification entry is reserved for higher-order users. After the webconsole is perfected, the console UI needs to join the manual stop retry button. |
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
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
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
* add: add time limit when transaction retry on the server * fix: change int to long * add: Configuration api add getDuration() * add: copyright * fix: use test case instead main * add new config items to the nacos-config.txt * fix * parse -1 and default Duration.ofMillis(-1) * add comment
Ⅰ. Describe what this PR did
add time limit when transaction retry on the server
Provide configuration items in file.conf :
max.commit.retry.timeout=
max.rollback.retry.timeout=
default permanent.
The retry timeout period is determined by the user. If it is not configured or configured as a negative number, it will run permanently; if configured to 0, it will be removed from the retry list on the first detection.
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews