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: add xa #467

Merged
merged 24 commits into from
Mar 17, 2023
Merged

feat: add xa #467

merged 24 commits into from
Mar 17, 2023

Conversation

georgehao
Copy link
Contributor

What this PR does:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@github-actions github-actions bot added the coding label Feb 4, 2023
@github-actions github-actions bot added the rm label Feb 27, 2023
@georgehao georgehao changed the title [WIP]feat: add xa feat: add xa Feb 27, 2023
@jasondeng1997
Copy link
Member

fix Conflict


func (db *DBResource) init() error {
db.checkDbVersion()
return nil
Copy link
Contributor

@wang1309 wang1309 Mar 11, 2023

Choose a reason for hiding this comment

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

如果写死的return nil,那是不是可以不需要error 返回值了

"database/sql"
"flag"
"fmt"
"github.com/pkg/errors"
Copy link
Contributor

Choose a reason for hiding this comment

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

格式化一下

}

if !c.xaActive || c.xaBranchXid == nil {
return fmt.Errorf("should NOT rollback on an inactive session")
Copy link
Contributor

Choose a reason for hiding this comment

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

是不是可以改为 errors.new

}

if !c.xaActive || c.xaBranchXid == nil {
return fmt.Errorf("should NOT commit on an inactive session")
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 *seataConnector) dbVersion(ctx context.Context, conn driver.Conn) (string, error) {
queryConn, isQueryContext := conn.(driver.QueryerContext)
if !isQueryContext {
return "", fmt.Errorf("get db version error for unexecpt driver conn")
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

size := len(parts)
maxVersionDot := 3
if size > maxVersionDot+1 {
return 0, fmt.Errorf("incompatible version format: %s" + version)
Copy link
Contributor

Choose a reason for hiding this comment

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

fmt.Errorf("incompatible version format: %s" , version) 这里是不是应该是这个,+改为,

}

type XAConfig struct {
xaConnConf XAConnConf
Copy link
Contributor

Choose a reason for hiding this comment

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

【小提示】seata-java好像没有这个配置

Copy link
Contributor Author

Choose a reason for hiding this comment

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

有的,他只有一个字段。branchExecutionTimeoutXA

@codecov-commenter
Copy link

codecov-commenter commented Mar 15, 2023

Codecov Report

Merging #467 (e007cf4) into master (46da59f) will decrease coverage by 1.56%.
The diff coverage is 29.83%.

📣 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     #467      +/-   ##
==========================================
- Coverage   38.38%   36.83%   -1.56%     
==========================================
  Files         155      159       +4     
  Lines       10319    11020     +701     
==========================================
+ Hits         3961     4059      +98     
- Misses       6032     6615     +583     
- Partials      326      346      +20     
Impacted Files Coverage Δ
pkg/client/client.go 0.00% <0.00%> (ø)
pkg/datasource/sql/at_resource_manager.go 0.00% <ø> (ø)
pkg/datasource/sql/conn_at.go 49.20% <ø> (ø)
pkg/datasource/sql/exec/executor.go 0.00% <ø> (ø)
.../datasource/sql/exec/select_for_update_executor.go 0.00% <ø> (ø)
pkg/datasource/sql/plugin.go 100.00% <ø> (ø)
pkg/datasource/sql/tx_at.go 23.52% <ø> (ø)
pkg/datasource/sql/tx_xa.go 45.45% <0.00%> (+12.12%) ⬆️
pkg/datasource/sql/types/types.go 12.82% <ø> (ø)
pkg/datasource/sql/xa/oracle_xa_connection.go 0.00% <ø> (ø)
... and 14 more

... and 3 files with indirect coverage changes

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

@georgehao georgehao merged commit 27cba64 into apache:master Mar 17, 2023
georgehao added 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants