Skip to content
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

feat: XA connect manager #433

Merged
merged 8 commits into from
Feb 4, 2023
Merged

feat: XA connect manager #433

merged 8 commits into from
Feb 4, 2023

Conversation

raspberry-hu
Copy link
Contributor

What this PR does:

Which issue(s) this PR fixes:

Fixes #344

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@github-actions github-actions bot added the coding label Jan 2, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jan 2, 2023

Codecov Report

Merging #433 (457c817) into master (a2fd83b) will decrease coverage by 1.28%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #433      +/-   ##
==========================================
- Coverage   40.59%   39.32%   -1.28%     
==========================================
  Files         139      143       +4     
  Lines        8749     9063     +314     
==========================================
+ Hits         3552     3564      +12     
- Misses       4908     5205     +297     
- Partials      289      294       +5     
Impacted Files Coverage Δ
pkg/datasource/sql/conn.go 15.06% <0.00%> (-0.21%) ⬇️
pkg/datasource/sql/datasource_resource.go 0.00% <0.00%> (ø)
pkg/datasource/sql/xa/xa_connection_proxy.go 0.00% <0.00%> (ø)
pkg/datasource/sql/exec/at/at_executor.go 0.00% <0.00%> (-3.71%) ⬇️
pkg/datasource/sql/exec/executor.go 0.00% <0.00%> (-3.45%) ⬇️
...e/sql/undo/builder/mysql_multi_undo_log_builder.go 0.00% <0.00%> (-2.64%) ⬇️
.../sql/undo/builder/mysql_delete_undo_log_builder.go 32.30% <0.00%> (-2.03%) ⬇️
.../sql/undo/builder/mysql_update_undo_log_builder.go 0.00% <0.00%> (-1.18%) ⬇️
...mysql_insertonduplicate_update_undo_log_builder.go 47.90% <0.00%> (-0.49%) ⬇️
pkg/datasource/sql/conn_at.go 49.18% <0.00%> (-0.41%) ⬇️
... and 19 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

"time"

"github.com/seata/seata-go/pkg/datasource/sql/types"
"github.com/seata/seata-go/pkg/protocol/branch"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

顺序弄反了吧

"github.com/seata/seata-go/pkg/datasource/sql/datasource"
"github.com/seata/seata-go/pkg/datasource/sql/exec"
"github.com/seata/seata-go/pkg/protocol/branch"
"github.com/seata/seata-go/pkg/protocol/message"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format

var rootContext sql.RootContext
transactionTimeout, ok := rootContext.GetTimeout()
if !ok {
transactionTimeout = int(60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里弄成常量吧


func (c *ConnectionProxyXA) releaseIfNecessary() {
if c.ShouldBeHeld() {
if reflect.DeepEqual(c.xaBranchXid, XABranchXid{}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里没必要这么写吧,直接判断null吧

func (c *ConnectionProxyXA) XaRollbackByBranchId(xid string, branchId int64, applicationData string) {
xaXid := Build(xid, branchId)
c.XaRollback(xaXid)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

缺了点单测

@georgehao georgehao merged commit 2dc5000 into apache:master Feb 4, 2023
georgehao pushed a commit to georgehao/seata-go that referenced this pull request May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ XA ] XA connect manager
3 participants