-
Notifications
You must be signed in to change notification settings - Fork 278
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
feat: add xa #467
Conversation
fix Conflict |
pkg/datasource/sql/db.go
Outdated
|
||
func (db *DBResource) init() error { | ||
db.checkDbVersion() | ||
return nil |
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.
如果写死的return nil,那是不是可以不需要error 返回值了
"database/sql" | ||
"flag" | ||
"fmt" | ||
"github.com/pkg/errors" |
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.
格式化一下
} | ||
|
||
if !c.xaActive || c.xaBranchXid == nil { | ||
return fmt.Errorf("should NOT rollback on an inactive session") |
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.
是不是可以改为 errors.new
} | ||
|
||
if !c.xaActive || c.xaBranchXid == nil { | ||
return fmt.Errorf("should NOT commit on an inactive session") |
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.
同上
pkg/datasource/sql/connector.go
Outdated
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") |
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.
同上
pkg/datasource/sql/util/convert.go
Outdated
size := len(parts) | ||
maxVersionDot := 3 | ||
if size > maxVersionDot+1 { | ||
return 0, fmt.Errorf("incompatible version format: %s" + version) |
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.
fmt.Errorf("incompatible version format: %s" , version) 这里是不是应该是这个,+改为,
} | ||
|
||
type XAConfig struct { | ||
xaConnConf XAConnConf |
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.
【小提示】seata-java好像没有这个配置
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.
有的,他只有一个字段。branchExecutionTimeoutXA
Codecov Report
📣 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
... 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. |
* feat: add xa
What this PR does:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: