Browse Source

Merge branch 'v2' of github.com:opentrx/seata-golang into feature/client-proxy-ut

# Conflicts:
#	.github/workflows/main.yml
pull/69/head
hehe.bu 4 years ago
parent
commit
b19aa29f98
44 changed files with 1870 additions and 1191 deletions
  1. +15
    -0
      .editorconfig
  2. +67
    -14
      .github/workflows/main.yml
  3. +2
    -1
      .gitignore
  4. +18
    -0
      .golangci.yml
  5. +45
    -0
      Makefile
  6. +4
    -3
      cmd/profiles/dev/config.yml
  7. +29
    -12
      cmd/tc/main.go
  8. +17
    -0
      dist/Dockerfile
  9. +44
    -0
      dist/config.yml
  10. +3
    -2
      go.mod
  11. +0
    -63
      go.sum
  12. +463
    -163
      pkg/apis/seata.pb.go
  13. +102
    -184
      pkg/apis/seata.proto
  14. +67
    -118
      pkg/apis/seata_grpc.pb.go
  15. +3
    -3
      pkg/client/base/context/root_context.go
  16. +0
    -18
      pkg/client/client.go
  17. +9
    -68
      pkg/client/config/configuration.go
  18. +3
    -7
      pkg/client/proxy/service.go
  19. +119
    -23
      pkg/client/rm/resource_manager.go
  20. +28
    -28
      pkg/client/tcc/proxy.go
  21. +16
    -18
      pkg/client/tcc/tcc_resource_manager.go
  22. +4
    -4
      pkg/client/tm/global_transaction.go
  23. +12
    -14
      pkg/client/tm/proxy.go
  24. +1
    -1
      pkg/client/tm/transaction_manager.go
  25. +19
    -0
      pkg/common/message_future.go
  26. +4
    -24
      pkg/tc/config/configuration.go
  27. +41
    -21
      pkg/tc/holder/session_holder.go
  28. +2
    -2
      pkg/tc/lock/lock_manager.go
  29. +73
    -80
      pkg/tc/metrics/metrics.go
  30. +20
    -11
      pkg/tc/metrics/promethues_exporter.go
  31. +0
    -2
      pkg/tc/model/global_transaction.go
  32. +37
    -0
      pkg/tc/server/callback_message_queue.go
  33. +2
    -1
      pkg/tc/server/global_session_locker.go
  34. +484
    -257
      pkg/tc/server/transaction_coordinator.go
  35. +7
    -7
      pkg/tc/storage/driver/factory/factory.go
  36. +32
    -3
      pkg/tc/storage/driver/inmemory/inmemory.go
  37. +26
    -7
      pkg/tc/storage/driver/mysql/mysql.go
  38. +25
    -7
      pkg/tc/storage/driver/pgsql/pgsql.go
  39. +1
    -1
      pkg/tc/storage/row_locker.go
  40. +4
    -1
      pkg/tc/storage/storagedriver.go
  41. +10
    -10
      pkg/util/log/logging.go
  42. +1
    -2
      pkg/util/mysql/mysql_keyword_checker.go
  43. +9
    -9
      pkg/util/sql/sql_type.go
  44. +2
    -2
      pkg/util/uuid/id_worker.go

+ 15
- 0
.editorconfig View File

@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

+ 67
- 14
.github/workflows/main.yml View File

@@ -3,33 +3,86 @@
name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the dev branch
# events for all branches and tags
on:
push:
branches: [ dev ]
branches: [ '**' ]
pull_request:
branches: [ dev ]
branches: [ '**' ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "lint"
lint:
lint-and-test:
strategy:
matrix:
go-version: [ 1.15.x ]
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Set up Go
uses: actions/setup-go@v1
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: ${{ matrix.go-version }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Lint Go Code
- name: Checkout code
uses: actions/checkout@v2

- name: Go Build
run: |
go build ./...

- name: Go Vet
run: |
go vet -v ./...

- name: GolangCI Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.39.0
golangci-lint run ./...

- name: Unit Tests
run: |
mkdir -p build
go test ./... -coverprofile=./build/c.out

- name: Code Coverage
run: |
go get github.com/axw/gocov/gocov
go get github.com/AlekSi/gocov-xml
go tool cover -html=build/c.out -o build/coverage.html
gocov convert build/c.out | gocov-xml > build/coverage.xml

- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: build/

docker-build:
strategy:
matrix:
go-version: [ 1.15.x ]
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Docker Build
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v2' || contains(github.ref, 'release') }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
go mod tidy
REGISTRY=$DOCKER_USERNAME make build-images

- name: Push
if: ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/v2' || contains(github.ref, 'release') }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
COMMIT: ${{ github.sha }}
run: |
export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
go get -u golang.org/x/lint/golint
golint ./...
go test ./...
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
REGISTRY=$DOCKER_USERNAME make push

+ 2
- 1
.gitignore View File

@@ -20,4 +20,5 @@ root.data.1
trace.out
cmd/tc/cmd
cmd/tc/tc
cmd/tc/trace.out
cmd/tc/trace.out
dist/tc

+ 18
- 0
.golangci.yml View File

@@ -0,0 +1,18 @@
run:
deadline: 5m

linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- structcheck
- typecheck
- varcheck
- goimports
- gocritic
- revive

+ 45
- 0
Makefile View File

@@ -0,0 +1,45 @@
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
GO_VERSION = 1.15

REGISTRY ?= seataio
TAG = $(shell git rev-parse --abbrev-ref HEAD)
COMMIT = git-$(shell git rev-parse --short HEAD)
DATE = $(shell date +"%Y-%m-%d_%H:%M:%S")
GOLDFLAGS = "-w -s -extldflags '-z now' -X github.com/opentrx/seata-golang/versions.COMMIT=$(COMMIT) -X github.com/opentrx/seata-golang/versions.BUILDDATE=$(DATE)"


.PHONY: build-go
build-go:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildmode=pie -o $(CURDIR)/dist/tc -ldflags $(GOLDFLAGS) -v ./cmd/tc

.PHONY: build-bin
build-bin:
docker run --rm -e GOOS=linux -e GOCACHE=/tmp -e GOARCH=$(ARCH) -e GOPROXY=https://goproxy.cn \
-u $(shell id -u):$(shell id -g) \
-v $(CURDIR):/go/src/github.com/opentrx/seata-golang:ro \
-v $(CURDIR)/dist:/go/src/github.com/opentrx/seata-golang/dist/ \
golang:$(GO_VERSION) /bin/bash -c '\
cd /go/src/github.com/opentrx/seata-golang && \
make build-go '

.PHONY: build-images
build-images: build-bin
docker build -t $(REGISTRY)/seata-golang:$(TAG) --build-arg ARCH=amd64 -f dist/Dockerfile dist/

.PHONY: push
push:
docker push $(REGISTRY)/seata-golang:$(TAG)

.PHONY: lint
lint:
@gofmt -d $(GOFILES_NOVENDOR)
@if [ $$(gofmt -l $(GOFILES_NOVENDOR) | wc -l) -ne 0 ]; then \
echo "Code differs from gofmt's style" 1>&2 && exit 1; \
fi
@GOOS=linux go vet ./...
@GOOS=linux gosec -exclude=G204,G601 ./...


.PHONY: clean
clean:
$(RM) dist/tc

+ 4
- 3
cmd/profiles/dev/config.yml View File

@@ -3,10 +3,11 @@ server:
maxRollbackRetryTimeout: -1
maxCommitRetryTimeout: -1
rollbackRetryTimeoutUnlockEnable: true
asyncCommittingRetryPeriod: 10s
committingRetryPeriod: 1s
asyncCommittingRetryPeriod: 1s
committingRetryPeriod: 5s
rollingBackRetryPeriod: 1s
timeoutRetryPeriod: 1s
streamMessageTimeout: 30s
enforcementPolicy:
minTime: 5s
permitWithoutStream: true
@@ -40,5 +41,5 @@ storage:
# maxidleconnections: 20
# maxlifetime: 4h
log:
logPath: /Users/scottlewis/dksl/current/seata-golang/cmd/profiles/dev/seata.log
logPath: /Users/scottlewis/dksl/git/1/seata-golang/cmd/profiles/dev/seata.log
logLevel: info

+ 29
- 12
cmd/tc/main.go View File

@@ -2,8 +2,9 @@ package main

import (
"fmt"
"github.com/opentrx/seata-golang/v2/pkg/util/uuid"
"net"
"net/http"
_ "net/http/pprof"
"os"

"github.com/urfave/cli/v2"
@@ -13,10 +14,11 @@ import (
"github.com/opentrx/seata-golang/v2/pkg/tc/config"
_ "github.com/opentrx/seata-golang/v2/pkg/tc/metrics"
"github.com/opentrx/seata-golang/v2/pkg/tc/server"
_ "github.com/opentrx/seata-golang/v2/pkg/tc/storage/driver/in_memory"
_ "github.com/opentrx/seata-golang/v2/pkg/tc/storage/driver/inmemory"
_ "github.com/opentrx/seata-golang/v2/pkg/tc/storage/driver/mysql"
_ "github.com/opentrx/seata-golang/v2/pkg/tc/storage/driver/pgsql"
"github.com/opentrx/seata-golang/v2/pkg/util/log"
"github.com/opentrx/seata-golang/v2/pkg/util/uuid"
)

func main() {
@@ -42,24 +44,34 @@ func main() {
configPath := c.String("config")
serverNode := c.Int64("serverNode")

config, err := resolveConfiguration(configPath)
cfg, err := resolveConfiguration(configPath)
if err != nil || cfg == nil {
return err
}

uuid.Init(serverNode)
log.Init(config.Log.LogPath, config.Log.LogLevel)
_ = uuid.Init(serverNode)
log.Init(cfg.Log.LogPath, cfg.Log.LogLevel)

address := fmt.Sprintf(":%v", config.Server.Port)
address := fmt.Sprintf(":%v", cfg.Server.Port)
lis, err := net.Listen("tcp", address)
if err != nil {
log.Fatalf("failed to listen: %v", err)
}

s := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(config.GetEnforcementPolicy()),
grpc.KeepaliveParams(config.GetServerParameters()))
s := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(cfg.GetEnforcementPolicy()),
grpc.KeepaliveParams(cfg.GetServerParameters()))

tc := server.NewTransactionCoordinator(config)
tc := server.NewTransactionCoordinator(cfg)
apis.RegisterTransactionManagerServiceServer(s, tc)
apis.RegisterResourceManagerServiceServer(s, tc)

go func() {
err = http.ListenAndServe(":10001", nil)
if err != nil {
return
}
}()

if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
@@ -93,12 +105,17 @@ func resolveConfiguration(configPath string) (*config.Configuration, error) {
return nil, err
}

defer fp.Close()
defer func(fp *os.File) {
err = fp.Close()
if err != nil {
log.Error(err)
}
}(fp)

config, err := config.Parse(fp)
cfg, err := config.Parse(fp)
if err != nil {
return nil, fmt.Errorf("error parsing %s: %v", configurationPath, err)
}

return config, nil
return cfg, nil
}

+ 17
- 0
dist/Dockerfile View File

@@ -0,0 +1,17 @@
FROM alpine:3.14.1

RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories && \
apk add --no-cache tcpdump lsof net-tools tzdata curl dumb-init libc6-compat

ENV TZ Asia/Shanghai
ENV PATH=$PATH:/opt/seata-golang/bin

WORKDIR /opt/seata-golang/bin

COPY tc /opt/seata-golang/bin/tc
COPY config.yml /etc/seata-golang/config.yml
RUN chmod +x /opt/seata-golang/bin/tc

ENTRYPOINT ["/usr/bin/dumb-init", "--"]

CMD ["/opt/seata-golang/bin/tc", "start", "-config", "/etc/seata-golang/config.yml"]

+ 44
- 0
dist/config.yml View File

@@ -0,0 +1,44 @@
server:
port: 8091
maxRollbackRetryTimeout: -1
maxCommitRetryTimeout: -1
rollbackRetryTimeoutUnlockEnable: true
asyncCommittingRetryPeriod: 10s
committingRetryPeriod: 1s
rollingBackRetryPeriod: 1s
timeoutRetryPeriod: 1s
enforcementPolicy:
minTime: 5s
permitWithoutStream: true
serverParameters:
maxConnectionIdle: 15s
maxConnectionAge: 30s
maxConnectionAgeGrace: 5s
time: 5s
timeout: 1s
clientParameters:
time: 10s
timeout: 1s
permitWithoutStream: true
storage:
# inMemory driver only for testing
inmemory:
# mysql:
# dsn: "root:123456@tcp(127.0.0.1:3306)/seata?timeout=1s&readTimeout=1s&writeTimeout=1s&parseTime=true&loc=Local&charset=utf8mb4,utf8"
# globaltable: global_table2
# branchtable: branch_table2
# locktable: lock_table
# maxopenconnections: 100
# maxidleconnections: 20
# maxlifetime: 4h
# pgsql:
# dsn: "postgres://postgres:123456@127.0.0.1:5432/seata?search_path=public&sslmode=disable"
# globaltable: global_table
# branchtable: branch_table
# locktable: lock_table
# maxopenconnections: 100
# maxidleconnections: 20
# maxlifetime: 4h
log:
logPath: seata.log
logLevel: info

+ 3
- 2
go.mod View File

@@ -14,9 +14,10 @@ require (
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a
github.com/stretchr/testify v1.7.0 // indirect
github.com/urfave/cli/v2 v2.3.0
go.uber.org/atomic v1.7.0
go.uber.org/zap v1.17.0
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/tools v0.1.4 // indirect
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
google.golang.org/grpc v1.38.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0


+ 0
- 63
go.sum View File

@@ -1,6 +1,5 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
@@ -23,7 +22,6 @@ github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g=
github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
@@ -43,7 +41,6 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l
github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU=
github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -78,7 +75,6 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/go-systemd/v22 v22.1.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -117,10 +113,6 @@ github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/getsentry/raven-go v0.2.0/go.mod h1:KungGk8q33+aIAZUIVWZDr2OfAEBsO49PX4NzFV5kcQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.6.2 h1:88crIK23zO6TqlQBt+f9FrPJNKm9ZEr7qjp9vl/d5TM=
github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
@@ -130,18 +122,8 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
@@ -178,7 +160,6 @@ github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrU
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
@@ -205,7 +186,6 @@ github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
@@ -253,15 +233,12 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 h1:uC1QfSlInpQF+M0ao65imhwqKnz3Q2z/d8PWZRMQvDM=
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40=
github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
@@ -271,15 +248,11 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570/go.mod h1:BLt8L9ld7wVsvEWQbuLrUZnCMnUmLZ+CGDzKtclrTlE=
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f/go.mod h1:UGmTpUd3rjbtfIpwAPrcfmGf/Z1HS95TATB+m57TPB8=
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042/go.mod h1:TPpsiPUEh0zFL1Snz4crhMlBe60PYxRHr5oFF3rRYg0=
@@ -290,11 +263,9 @@ github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0U
github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
@@ -311,10 +282,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu
github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
@@ -354,7 +323,6 @@ github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -363,7 +331,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
@@ -375,13 +342,11 @@ github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66Id
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
@@ -391,7 +356,6 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8
github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM=
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
@@ -410,7 +374,6 @@ github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shirou/gopsutil v3.20.11+incompatible h1:LJr4ZQK4mPpIV5gOa4jCOKOGb4ty4DZO54I4FGqIpto=
github.com/shirou/gopsutil v3.20.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
@@ -443,7 +406,6 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
@@ -454,10 +416,6 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/toolkits/concurrent v0.0.0-20150624120057-a4371d70e3e3/go.mod h1:QDlpd3qS71vYtakd2hmdpqhJ9nwv6mD6A30bQ1BPBFE=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.1 h1:+mkCCcOFKPnCmVYVcURKps1Xe+3zP90gSYGNfRkjoIY=
github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
@@ -466,7 +424,6 @@ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/X
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
@@ -510,7 +467,6 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 h1:hb9wdF1z5waM+dSIICn1l0DkLVDT3hqhhQsDNUmHPRE=
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
@@ -529,10 +485,7 @@ golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
@@ -541,7 +494,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -565,9 +517,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U=
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
@@ -583,7 +533,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -614,12 +563,10 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201223074533-0d417f636930 h1:vRgIt+nup/B/BwIS0g2oC0haq0iqbV3ZA+u6+0TlNCo=
golang.org/x/sys v0.0.0-20201223074533-0d417f636930/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
@@ -664,10 +611,7 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20201014170642-d1624618ad65/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a h1:CB3a9Nez8M13wwlr/E2YtwoU+qYHKfC+JrDa45RXXoQ=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.4 h1:cVngSRcfgyZCzys3KYOpCFa+4dqX/Oub9tAq00ttGVs=
golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@@ -683,9 +627,7 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.0 h1:Tfd7cKwKbFRsI8RMAD3oqqw7JPFRrvFlOsfbgVkjOOw=
google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I=
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -700,7 +642,6 @@ google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBr
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98 h1:LCO0fg4kb6WwkXQXRQQgUYsFeFb5taTX5WAx5O/Vt28=
google.golang.org/genproto v0.0.0-20200806141610-86f49bd18e98/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
@@ -727,7 +668,6 @@ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQ
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
@@ -735,7 +675,6 @@ google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU=
@@ -753,12 +692,10 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=


+ 463
- 163
pkg/apis/seata.pb.go View File

@@ -8,6 +8,7 @@ import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
types "github.com/gogo/protobuf/types"
io "io"
math "math"
math_bits "math/bits"
@@ -51,61 +52,42 @@ func (ResultCode) EnumDescriptor() ([]byte, []int) {
type ExceptionCode int32

const (
//*
// Unknown transaction error code.
UnknownErr ExceptionCode = 0
//*
// BeginFailed
BeginFailed ExceptionCode = 1
//*
// Lock key conflict transaction error code.
LockKeyConflict ExceptionCode = 2
//*
// Io transaction error code.
IO ExceptionCode = 3
//*
// Branch rollback failed retryable transaction error code.
BranchRollbackFailedRetryable ExceptionCode = 4
//*
// Branch rollback failed unretryable transaction error code.
BranchRollbackFailedUnretryable ExceptionCode = 5
//*
// Branch register failed transaction error code.
BranchRegisterFailed ExceptionCode = 6
//*
// Branch report failed transaction error code.
BranchReportFailed ExceptionCode = 7
//*
// Lockable check failed transaction error code.
LockableCheckFailed ExceptionCode = 8
//*
// Branch transaction not exist transaction error code.
BranchTransactionNotExist ExceptionCode = 9
//*
// Global transaction not exist transaction error code.
GlobalTransactionNotExist ExceptionCode = 10
//*
// Global transaction not active transaction error code.
GlobalTransactionNotActive ExceptionCode = 11
//*
// Global transaction status invalid transaction error code.
GlobalTransactionStatusInvalid ExceptionCode = 12
//*
// Failed to send branch commit request transaction error code.
FailedToSendBranchCommitRequest ExceptionCode = 13
//*
// Failed to send branch rollback request transaction error code.
FailedToSendBranchRollbackRequest ExceptionCode = 14
//*
// Failed to add branch transaction error code.
FailedToAddBranch ExceptionCode = 15
//*
// Failed to lock global transaction error code.
FailedLockGlobalTransaction ExceptionCode = 16
//*
// FailedWriteSession
FailedWriteSession ExceptionCode = 17
//*
// Failed to holder error code
FailedStore ExceptionCode = 18
)
@@ -158,66 +140,77 @@ func (ExceptionCode) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_450a439f8893981f, []int{1}
}

type BranchMessageType int32

const (
TypeBranchCommit BranchMessageType = 0
TypeBranchCommitResult BranchMessageType = 1
TypeBranchRollback BranchMessageType = 2
TypeBranchRollBackResult BranchMessageType = 3
)

var BranchMessageType_name = map[int32]string{
0: "TypeBranchCommit",
1: "TypeBranchCommitResult",
2: "TypeBranchRollback",
3: "TypeBranchRollBackResult",
}

var BranchMessageType_value = map[string]int32{
"TypeBranchCommit": 0,
"TypeBranchCommitResult": 1,
"TypeBranchRollback": 2,
"TypeBranchRollBackResult": 3,
}

func (BranchMessageType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_450a439f8893981f, []int{2}
}

type GlobalSession_GlobalStatus int32

const (
//*
// Un known global status.
UnknownGlobalStatus GlobalSession_GlobalStatus = 0
//*
// PHASE 1: can accept new branch registering.
Begin GlobalSession_GlobalStatus = 1
//*
// PHASE 2: Running Status: may be changed any time.
Committing GlobalSession_GlobalStatus = 2
//*
// The Commit retrying.
// Retrying commit after a recoverable failure.
CommitRetrying GlobalSession_GlobalStatus = 3
//*
// Rolling back global status.
RollingBack GlobalSession_GlobalStatus = 4
//*
// The Rollback retrying.
// Retrying rollback after a recoverable failure.
RollbackRetrying GlobalSession_GlobalStatus = 5
//*
// The Timeout rolling back.
// Rolling back since timeout
TimeoutRollingBack GlobalSession_GlobalStatus = 6
//*
// The Timeout rollback retrying.
// Retrying rollback (since timeout) after a recoverable failure.
TimeoutRollbackRetrying GlobalSession_GlobalStatus = 7
//*
// All branches can be async committed. The committing is NOT done yet, but it can be seen as committed for TM/RM
// rpc_client.
// All branches can be async committed. The committing is NOT done yet, but it can be seen as
// committed for TM/RM rpc_client.
AsyncCommitting GlobalSession_GlobalStatus = 8
//*
// PHASE 2: Final Status: will NOT change any more.
// Finally: global transaction is successfully committed.
Committed GlobalSession_GlobalStatus = 9
//*
// The Commit failed.
// Finally: failed to commit
CommitFailed GlobalSession_GlobalStatus = 10
//*
// The RolledBack.
// Finally: global transaction is successfully rollback.
RolledBack GlobalSession_GlobalStatus = 11
//*
// The Rollback failed.
// Finally: failed to rollback
RollbackFailed GlobalSession_GlobalStatus = 12
//*
// The Timeout rolled back.
// Finally: global transaction is successfully rollback since timeout.
TimeoutRolledBack GlobalSession_GlobalStatus = 13
//*
// The Timeout rollback failed.
// Finally: failed to rollback since timeout
TimeoutRollbackFailed GlobalSession_GlobalStatus = 14
//*
// The Finished.
// Not managed in getty_session MAP any more
Finished GlobalSession_GlobalStatus = 15
@@ -295,45 +288,34 @@ func (BranchSession_BranchType) EnumDescriptor() ([]byte, []int) {
type BranchSession_BranchStatus int32

const (
//*
// description:BranchStatus_Unknown branch status.
UnknownBranchStatus BranchSession_BranchStatus = 0
//*
// description:BranchStatus_Registered to TC.
Registered BranchSession_BranchStatus = 1
//*
// The Phase one done.
// description:Branch logic is successfully done at phase one.
PhaseOneDone BranchSession_BranchStatus = 2
//*
// The Phase one failed.
// description:Branch logic is failed at phase one.
PhaseOneFailed BranchSession_BranchStatus = 3
//*
// The Phase one timeout.
// description:Branch logic is NOT reported for a timeout.
PhaseOneTimeout BranchSession_BranchStatus = 4
//*
// The Phase two committed.
// description:Commit logic is successfully done at phase two.
PhaseTwoCommitted BranchSession_BranchStatus = 5
//*
// The Phase two commit failed retryable.
// description:Commit logic is failed but retryable.
PhaseTwoCommitFailedRetryable BranchSession_BranchStatus = 6
//*
// The Phase two commit failed and can not retry.
// description:Commit logic is failed and NOT retryable.
PhaseTwoCommitFailedCanNotRetry BranchSession_BranchStatus = 7
//*
// The Phase two rollback completed.
// description:Rollback logic is successfully done at phase two.
PhaseTwoRolledBack BranchSession_BranchStatus = 8
//*
// The Phase two rollback failed retryable.
// description:Rollback logic is failed but retryable.
PhaseTwoRollbackFailedRetryable BranchSession_BranchStatus = 9
//*
// The Phase two rollback failed and can not retry.
// description:Rollback logic is failed but NOT retryable.
PhaseTwoRollbackFailedCanNotRetry BranchSession_BranchStatus = 10
@@ -2020,9 +2002,69 @@ func (m *BranchRollbackResponse) GetBranchStatus() BranchSession_BranchStatus {
return UnknownBranchStatus
}

type BranchMessage struct {
ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
BranchMessageType BranchMessageType `protobuf:"varint,2,opt,name=BranchMessageType,proto3,enum=apis.BranchMessageType" json:"BranchMessageType,omitempty"`
Message *types.Any `protobuf:"bytes,3,opt,name=Message,proto3" json:"Message,omitempty"`
}

func (m *BranchMessage) Reset() { *m = BranchMessage{} }
func (*BranchMessage) ProtoMessage() {}
func (*BranchMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_450a439f8893981f, []int{23}
}
func (m *BranchMessage) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *BranchMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_BranchMessage.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *BranchMessage) XXX_Merge(src proto.Message) {
xxx_messageInfo_BranchMessage.Merge(m, src)
}
func (m *BranchMessage) XXX_Size() int {
return m.Size()
}
func (m *BranchMessage) XXX_DiscardUnknown() {
xxx_messageInfo_BranchMessage.DiscardUnknown(m)
}

var xxx_messageInfo_BranchMessage proto.InternalMessageInfo

func (m *BranchMessage) GetID() int64 {
if m != nil {
return m.ID
}
return 0
}

func (m *BranchMessage) GetBranchMessageType() BranchMessageType {
if m != nil {
return m.BranchMessageType
}
return TypeBranchCommit
}

func (m *BranchMessage) GetMessage() *types.Any {
if m != nil {
return m.Message
}
return nil
}

func init() {
proto.RegisterEnum("apis.ResultCode", ResultCode_name, ResultCode_value)
proto.RegisterEnum("apis.ExceptionCode", ExceptionCode_name, ExceptionCode_value)
proto.RegisterEnum("apis.BranchMessageType", BranchMessageType_name, BranchMessageType_value)
proto.RegisterEnum("apis.GlobalSession_GlobalStatus", GlobalSession_GlobalStatus_name, GlobalSession_GlobalStatus_value)
proto.RegisterEnum("apis.BranchSession_BranchType", BranchSession_BranchType_name, BranchSession_BranchType_value)
proto.RegisterEnum("apis.BranchSession_BranchStatus", BranchSession_BranchStatus_name, BranchSession_BranchStatus_value)
@@ -2049,127 +2091,134 @@ func init() {
proto.RegisterType((*BranchCommitResponse)(nil), "apis.BranchCommitResponse")
proto.RegisterType((*BranchRollbackRequest)(nil), "apis.BranchRollbackRequest")
proto.RegisterType((*BranchRollbackResponse)(nil), "apis.BranchRollbackResponse")
proto.RegisterType((*BranchMessage)(nil), "apis.BranchMessage")
}

func init() { proto.RegisterFile("seata.proto", fileDescriptor_450a439f8893981f) }

var fileDescriptor_450a439f8893981f = []byte{
// 1830 bytes of a gzipped FileDescriptorProto
// 1931 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x59, 0xcd, 0x6f, 0x23, 0x49,
0x15, 0x77, 0xb7, 0xbf, 0x5f, 0x62, 0xbb, 0x52, 0x99, 0x24, 0x4e, 0x86, 0xb4, 0x33, 0xbd, 0x5a,
0x91, 0x1d, 0xd8, 0xc9, 0x2a, 0x23, 0x90, 0x16, 0x21, 0x56, 0x76, 0x92, 0x1d, 0x42, 0xd8, 0xdd,
0xa1, 0x93, 0x15, 0x2b, 0x2e, 0xa3, 0x4e, 0xbb, 0x70, 0x5a, 0xb1, 0xbb, 0x4d, 0x77, 0x7b, 0x92,
0xdc, 0xb8, 0x73, 0x00, 0xb4, 0x37, 0x24, 0x6e, 0x1c, 0x38, 0xed, 0x8d, 0x13, 0xfc, 0x01, 0x1c,
0x38, 0xcc, 0x09, 0xed, 0xc9, 0x62, 0x32, 0x42, 0x80, 0x04, 0xd2, 0xca, 0x07, 0xce, 0xa8, 0x3e,
0xda, 0x5d, 0xd5, 0x76, 0xd6, 0x93, 0x05, 0x84, 0x99, 0x63, 0xbf, 0xfa, 0xd5, 0xab, 0x57, 0xef,
0xbd, 0xdf, 0x7b, 0x55, 0xd5, 0xb0, 0x10, 0x12, 0x3b, 0xb2, 0x1f, 0xf4, 0x03, 0x3f, 0xf2, 0x71,
0xce, 0xee, 0xbb, 0xe1, 0x06, 0x74, 0xfc, 0x8e, 0xcf, 0x25, 0xe6, 0x2f, 0x0a, 0x50, 0x79, 0xd4,
0xf5, 0x4f, 0xed, 0xee, 0x31, 0x09, 0x43, 0xd7, 0xf7, 0xf0, 0xd7, 0x00, 0x9a, 0xed, 0x76, 0x40,
0xbf, 0xbc, 0x4e, 0x5d, 0xdb, 0xd2, 0xb6, 0xcb, 0xad, 0x95, 0xd1, 0xb0, 0xb1, 0x74, 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 0x95, 0xa1, 0xfd, 0xe5, 0xca, 0xd0, 0xfe, 0x7e,
0x65, 0x24, 0x3e, 0xb9, 0x32, 0xb4, 0x9f, 0x5e, 0x1b, 0x89, 0xe7, 0xd7, 0x46, 0xe2, 0xe3, 0x6b,
0x23, 0xf1, 0xfd, 0x2f, 0x77, 0x9c, 0xf0, 0xb4, 0x7f, 0xb2, 0xd5, 0xf2, 0xce, 0xb7, 0xbd, 0x1e,
0x71, 0x43, 0xff, 0x72, 0x9b, 0xfd, 0x0f, 0x7d, 0xa3, 0xe3, 0x75, 0x6d, 0xb7, 0xb3, 0xfd, 0x6c,
0x67, 0xbb, 0x77, 0xd6, 0xd9, 0xa6, 0x5b, 0x9f, 0x64, 0x58, 0xb9, 0x7f, 0xf4, 0xef, 0x00, 0x00,
0x00, 0xff, 0xff, 0xf4, 0xc7, 0x17, 0x6a, 0x32, 0x1d, 0x00, 0x00,
}

func (x ResultCode) String() string {
@@ -2186,6 +2235,13 @@ func (x ExceptionCode) String() string {
}
return strconv.Itoa(int(x))
}
func (x BranchMessageType) String() string {
s, ok := BranchMessageType_name[int32(x)]
if ok {
return s
}
return strconv.Itoa(int(x))
}
func (x GlobalSession_GlobalStatus) String() string {
s, ok := GlobalSession_GlobalStatus_name[int32(x)]
if ok {
@@ -2999,6 +3055,36 @@ func (this *BranchRollbackResponse) Equal(that interface{}) bool {
}
return true
}
func (this *BranchMessage) Equal(that interface{}) bool {
if that == nil {
return this == nil
}

that1, ok := that.(*BranchMessage)
if !ok {
that2, ok := that.(BranchMessage)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if this.ID != that1.ID {
return false
}
if this.BranchMessageType != that1.BranchMessageType {
return false
}
if !this.Message.Equal(that1.Message) {
return false
}
return true
}
func (this *GlobalSession) GoString() string {
if this == nil {
return "nil"
@@ -3309,6 +3395,20 @@ func (this *BranchRollbackResponse) GoString() string {
s = append(s, "}")
return strings.Join(s, "")
}
func (this *BranchMessage) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 7)
s = append(s, "&apis.BranchMessage{")
s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n")
s = append(s, "BranchMessageType: "+fmt.Sprintf("%#v", this.BranchMessageType)+",\n")
if this.Message != nil {
s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n")
}
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringSeata(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@@ -4473,6 +4573,51 @@ func (m *BranchRollbackResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
return len(dAtA) - i, nil
}

func (m *BranchMessage) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}

func (m *BranchMessage) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *BranchMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if m.Message != nil {
{
size, err := m.Message.MarshalToSizedBuffer(dAtA[:i])
if err != nil {
return 0, err
}
i -= size
i = encodeVarintSeata(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x1a
}
if m.BranchMessageType != 0 {
i = encodeVarintSeata(dAtA, i, uint64(m.BranchMessageType))
i--
dAtA[i] = 0x10
}
if m.ID != 0 {
i = encodeVarintSeata(dAtA, i, uint64(m.ID))
i--
dAtA[i] = 0x8
}
return len(dAtA) - i, nil
}

func encodeVarintSeata(dAtA []byte, offset int, v uint64) int {
offset -= sovSeata(v)
base := offset
@@ -5051,6 +5196,25 @@ func (m *BranchRollbackResponse) Size() (n int) {
return n
}

func (m *BranchMessage) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.ID != 0 {
n += 1 + sovSeata(uint64(m.ID))
}
if m.BranchMessageType != 0 {
n += 1 + sovSeata(uint64(m.BranchMessageType))
}
if m.Message != nil {
l = m.Message.Size()
n += 1 + l + sovSeata(uint64(l))
}
return n
}

func sovSeata(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@@ -5367,6 +5531,18 @@ func (this *BranchRollbackResponse) String() string {
}, "")
return s
}
func (this *BranchMessage) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&BranchMessage{`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`BranchMessageType:` + fmt.Sprintf("%v", this.BranchMessageType) + `,`,
`Message:` + strings.Replace(fmt.Sprintf("%v", this.Message), "Any", "types.Any", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringSeata(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@@ -9157,6 +9333,130 @@ func (m *BranchRollbackResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *BranchMessage) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSeata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: BranchMessage: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: BranchMessage: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
}
m.ID = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSeata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ID |= int64(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field BranchMessageType", wireType)
}
m.BranchMessageType = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSeata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.BranchMessageType |= BranchMessageType(b&0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSeata
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthSeata
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthSeata
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Message == nil {
m.Message = &types.Any{}
}
if err := m.Message.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipSeata(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSeata
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}

if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipSeata(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0


+ 102
- 184
pkg/apis/seata.proto View File

@@ -3,6 +3,7 @@ syntax = "proto3";
package apis;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package="github.com/opentrx/seata-golang/v2/pkg/apis";

@@ -12,194 +13,131 @@ enum ResultCode {
}

enum ExceptionCode {
/**
* Unknown transaction error code.
*/
// Unknown transaction error code.
UnknownErr = 0;

/**
* BeginFailed
*/
// BeginFailed
BeginFailed = 1;

/**
* Lock key conflict transaction error code.
*/
// Lock key conflict transaction error code.
LockKeyConflict = 2;

/**
* Io transaction error code.
*/
// Io transaction error code.
IO = 3;

/**
* Branch rollback failed retryable transaction error code.
*/
// Branch rollback failed retryable transaction error code.
BranchRollbackFailedRetryable = 4;

/**
* Branch rollback failed unretryable transaction error code.
*/
// Branch rollback failed unretryable transaction error code.
BranchRollbackFailedUnretryable = 5;

/**
* Branch register failed transaction error code.
*/
// Branch register failed transaction error code.
BranchRegisterFailed = 6;

/**
* Branch report failed transaction error code.
*/
// Branch report failed transaction error code.
BranchReportFailed = 7;

/**
* Lockable check failed transaction error code.
*/
// Lockable check failed transaction error code.
LockableCheckFailed = 8;

/**
* Branch transaction not exist transaction error code.
*/
// Branch transaction not exist transaction error code.
BranchTransactionNotExist = 9;

/**
* Global transaction not exist transaction error code.
*/
// Global transaction not exist transaction error code.
GlobalTransactionNotExist = 10;

/**
* Global transaction not active transaction error code.
*/
// Global transaction not active transaction error code.
GlobalTransactionNotActive = 11;

/**
* Global transaction status invalid transaction error code.
*/
// Global transaction status invalid transaction error code.
GlobalTransactionStatusInvalid = 12;

/**
* Failed to send branch commit request transaction error code.
*/
// Failed to send branch commit request transaction error code.
FailedToSendBranchCommitRequest = 13;

/**
* Failed to send branch rollback request transaction error code.
*/
// Failed to send branch rollback request transaction error code.
FailedToSendBranchRollbackRequest = 14;

/**
* Failed to add branch transaction error code.
*/
// Failed to add branch transaction error code.
FailedToAddBranch = 15;

/**
* Failed to lock global transaction error code.
*/
// Failed to lock global transaction error code.
FailedLockGlobalTransaction = 16;

/**
* FailedWriteSession
*/
// FailedWriteSession
FailedWriteSession = 17;

/**
* Failed to holder error code
*/
// Failed to holder error code
FailedStore = 18;
}

enum BranchMessageType {
TypeBranchCommit = 0;
TypeBranchCommitResult = 1;
TypeBranchRollback = 2;
TypeBranchRollBackResult = 3;
}

message GlobalSession {
enum GlobalStatus {
/**
* Un known global status.
*/
// Un known global status.
UnknownGlobalStatus = 0;

/**
* PHASE 1: can accept new branch registering.
*/
// PHASE 1: can accept new branch registering.
Begin = 1;

/**
* PHASE 2: Running Status: may be changed any time.
*/
// PHASE 2: Running Status: may be changed any time.
Committing = 2;

/**
* The Commit retrying.
* Retrying commit after a recoverable failure.
*/
// The Commit retrying.
// Retrying commit after a recoverable failure.
CommitRetrying = 3;

/**
* Rolling back global status.
*/
// Rolling back global status.
RollingBack = 4;

/**
* The Rollback retrying.
* Retrying rollback after a recoverable failure.
*/
// The Rollback retrying.
// Retrying rollback after a recoverable failure.
RollbackRetrying = 5;

/**
* The Timeout rolling back.
* Rolling back since timeout
*/
// The Timeout rolling back.
// Rolling back since timeout
TimeoutRollingBack = 6;

/**
* The Timeout rollback retrying.
* Retrying rollback (since timeout) after a recoverable failure.
*/
// The Timeout rollback retrying.
// Retrying rollback (since timeout) after a recoverable failure.
TimeoutRollbackRetrying = 7;

/**
* All branches can be async committed. The committing is NOT done yet, but it can be seen as committed for TM/RM
* rpc_client.
*/
// All branches can be async committed. The committing is NOT done yet, but it can be seen as
// committed for TM/RM rpc_client.
AsyncCommitting = 8;

/**
* PHASE 2: Final Status: will NOT change any more.
* Finally: global transaction is successfully committed.
*/
// PHASE 2: Final Status: will NOT change any more.
// Finally: global transaction is successfully committed.
Committed = 9;

/**
* The Commit failed.
* Finally: failed to commit
*/
// The Commit failed.
// Finally: failed to commit
CommitFailed = 10;

/**
* The RolledBack.
* Finally: global transaction is successfully rollback.
*/
// The RolledBack.
// Finally: global transaction is successfully rollback.
RolledBack = 11;

/**
* The Rollback failed.
* Finally: failed to rollback
*/
// The Rollback failed.
// Finally: failed to rollback
RollbackFailed = 12;

/**
* The Timeout rolled back.
* Finally: global transaction is successfully rollback since timeout.
*/
// The Timeout rolled back.
// Finally: global transaction is successfully rollback since timeout.
TimeoutRolledBack = 13;

/**
* The Timeout rollback failed.
* Finally: failed to rollback since timeout
*/
// The Timeout rollback failed.
// Finally: failed to rollback since timeout
TimeoutRollbackFailed = 14;

/**
* The Finished.
* Not managed in getty_session MAP any more
*/
// The Finished.
// Not managed in getty_session MAP any more
Finished = 15;
}

@@ -225,68 +163,46 @@ message BranchSession {
}

enum BranchStatus {
/**
* description:BranchStatus_Unknown branch status.
*/
// description:BranchStatus_Unknown branch status.
UnknownBranchStatus = 0;

/**
* description:BranchStatus_Registered to TC.
*/
// description:BranchStatus_Registered to TC.
Registered = 1;

/**
* The Phase one done.
* description:Branch logic is successfully done at phase one.
*/
// The Phase one done.
// description:Branch logic is successfully done at phase one.
PhaseOneDone = 2;

/**
* The Phase one failed.
* description:Branch logic is failed at phase one.
*/
// The Phase one failed.
// description:Branch logic is failed at phase one.
PhaseOneFailed = 3;

/**
* The Phase one timeout.
* description:Branch logic is NOT reported for a timeout.
*/
// The Phase one timeout.
// description:Branch logic is NOT reported for a timeout.
PhaseOneTimeout = 4;

/**
* The Phase two committed.
* description:Commit logic is successfully done at phase two.
*/
// The Phase two committed.
// description:Commit logic is successfully done at phase two.
PhaseTwoCommitted = 5;

/**
* The Phase two commit failed retryable.
* description:Commit logic is failed but retryable.
*/
// The Phase two commit failed retryable.
// description:Commit logic is failed but retryable.
PhaseTwoCommitFailedRetryable = 6;

/**
* The Phase two commit failed and can not retry.
* description:Commit logic is failed and NOT retryable.
*/
// The Phase two commit failed and can not retry.
// description:Commit logic is failed and NOT retryable.
PhaseTwoCommitFailedCanNotRetry = 7;

/**
* The Phase two rollback completed.
* description:Rollback logic is successfully done at phase two.
*/
// The Phase two rollback completed.
// description:Rollback logic is successfully done at phase two.
PhaseTwoRolledBack = 8;

/**
* The Phase two rollback failed retryable.
* description:Rollback logic is failed but retryable.
*/
// The Phase two rollback failed retryable.
// description:Rollback logic is failed but retryable.
PhaseTwoRollbackFailedRetryable = 9;

/**
* The Phase two rollback failed and can not retry.
* description:Rollback logic is failed but NOT retryable.
*/
// The Phase two rollback failed and can not retry.
// description:Rollback logic is failed but NOT retryable.
PhaseTwoRollbackFailedCanNotRetry = 10;
}

@@ -311,14 +227,14 @@ message RowLock {
string RowKey = 7 [(gogoproto.moretags) = "xorm:\"row_key\""];
}

/* GlobalBeginRequest represents a global transaction begin */
// GlobalBeginRequest represents a global transaction begin
message GlobalBeginRequest {
string Addressing = 1;
int32 Timeout = 2;
string TransactionName = 3;
}

/* GlobalBeginResponse represents a response to GlobalBeginRequest */
// GlobalBeginResponse represents a response to GlobalBeginRequest
message GlobalBeginResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -326,7 +242,7 @@ message GlobalBeginResponse {
string XID = 4;
}

/* BranchRegisterRequest represents a branch transaction join in the global transaction */
// BranchRegisterRequest represents a branch transaction join in the global transaction
message BranchRegisterRequest {
string Addressing = 1;
string XID = 2;
@@ -336,7 +252,7 @@ message BranchRegisterRequest {
bytes ApplicationData = 6;
}

/* BranchRegisterResponse represents a response to BranchRegisterRequest */
// BranchRegisterResponse represents a response to BranchRegisterRequest
message BranchRegisterResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -344,7 +260,7 @@ message BranchRegisterResponse {
int64 BranchID = 4;
}

/* BranchReportRequest represents a request to report branch transaction execution status */
// BranchReportRequest represents a request to report branch transaction execution status
message BranchReportRequest {
string XID = 1;
int64 BranchID = 2;
@@ -354,14 +270,14 @@ message BranchReportRequest {
bytes ApplicationData = 6;
}

/* BranchReportResponse represents a response to BranchReportRequest */
// BranchReportResponse represents a response to BranchReportRequest
message BranchReportResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
string Message = 3;
}

/* GlobalLockQueryRequest represents a request to query the global lock */
// GlobalLockQueryRequest represents a request to query the global lock
message GlobalLockQueryRequest {
string XID = 1;
string ResourceID = 2;
@@ -369,7 +285,7 @@ message GlobalLockQueryRequest {
BranchSession.BranchType BranchType = 4;
}

/* GlobalLockQueryResponse represents a response to GlobalLockQueryRequest */
// GlobalLockQueryResponse represents a response to GlobalLockQueryRequest
message GlobalLockQueryResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -377,12 +293,12 @@ message GlobalLockQueryResponse {
bool Lockable = 4;
}

/* GlobalStatusRequest represents a request to query the global transaction status */
// GlobalStatusRequest represents a request to query the global transaction status
message GlobalStatusRequest {
string XID = 1;
}

/* GlobalStatusResponse represents a response to GlobalStatusRequest */
// GlobalStatusResponse represents a response to GlobalStatusRequest
message GlobalStatusResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -390,12 +306,12 @@ message GlobalStatusResponse {
GlobalSession.GlobalStatus GlobalStatus = 4;
}

/* GlobalCommitRequest represents a request to commit global transaction */
// GlobalCommitRequest represents a request to commit global transaction
message GlobalCommitRequest {
string XID = 1;
}

/* GlobalCommitResponse represents a response to GlobalCommitRequest */
// GlobalCommitResponse represents a response to GlobalCommitRequest
message GlobalCommitResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -403,12 +319,12 @@ message GlobalCommitResponse {
GlobalSession.GlobalStatus GlobalStatus = 4;
}

/* GlobalRollbackRequest represents a request to rollback global transaction */
// GlobalRollbackRequest represents a request to rollback global transaction
message GlobalRollbackRequest {
string XID = 1;
}

/* GlobalRollbackResponse represents a response to GlobalRollbackRequest */
// GlobalRollbackResponse represents a response to GlobalRollbackRequest
message GlobalRollbackResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -416,13 +332,13 @@ message GlobalRollbackResponse {
GlobalSession.GlobalStatus GlobalStatus = 4;
}

/* GlobalReportRequest represents a request to report global transaction execution status */
// GlobalReportRequest represents a request to report global transaction execution status
message GlobalReportRequest {
string XID = 1;
GlobalSession.GlobalStatus GlobalStatus = 2;
}

/* GlobalReportResponse represents a response to GlobalReportRequest */
// GlobalReportResponse represents a response to GlobalReportRequest
message GlobalReportResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -430,7 +346,7 @@ message GlobalReportResponse {
GlobalSession.GlobalStatus GlobalStatus = 4;
}

/* BranchCommitRequest represents a request to commit branch transaction */
// BranchCommitRequest represents a request to commit branch transaction
message BranchCommitRequest {
string XID = 1;
int64 BranchID = 2;
@@ -440,7 +356,7 @@ message BranchCommitRequest {
bytes ApplicationData = 6;
}

/* BranchCommitResponse represents a response to BranchCommitRequest */
// BranchCommitResponse represents a response to BranchCommitRequest
message BranchCommitResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -450,7 +366,7 @@ message BranchCommitResponse {
BranchSession.BranchStatus BranchStatus = 6;
}

/* BranchCommitRequest represents a request to rollback branch transaction */
// BranchCommitRequest represents a request to rollback branch transaction
message BranchRollbackRequest {
string XID = 1;
int64 BranchID = 2;
@@ -460,7 +376,7 @@ message BranchRollbackRequest {
bytes ApplicationData = 6;
}

/* BranchRollbackResponse represents a response to BranchRollbackRequest */
// BranchRollbackResponse represents a response to BranchRollbackRequest
message BranchRollbackResponse {
ResultCode ResultCode = 1;
ExceptionCode ExceptionCode = 2;
@@ -470,6 +386,12 @@ message BranchRollbackResponse {
BranchSession.BranchStatus BranchStatus = 6;
}

message BranchMessage {
int64 ID = 1;
BranchMessageType BranchMessageType = 2;
google.protobuf.Any Message = 3;
}

service TransactionManagerService {
rpc Begin(GlobalBeginRequest) returns (GlobalBeginResponse);
rpc GetStatus(GlobalStatusRequest) returns (GlobalStatusResponse);
@@ -479,15 +401,11 @@ service TransactionManagerService {
}

service ResourceManagerService {
rpc BranchCommunicate(stream BranchMessage) returns (stream BranchMessage);
rpc BranchRegister(BranchRegisterRequest) returns (BranchRegisterResponse);
rpc BranchReport(BranchReportRequest) returns (BranchReportResponse);
rpc LockQuery(GlobalLockQueryRequest) returns (GlobalLockQueryResponse);
}

service BranchTransactionService {
rpc BranchCommit(BranchCommitRequest) returns (BranchCommitResponse);
rpc BranchRollback(BranchRollbackRequest) returns (BranchRollbackResponse);
}




+ 67
- 118
pkg/apis/seata_grpc.pb.go View File

@@ -246,6 +246,7 @@ var TransactionManagerService_ServiceDesc = grpc.ServiceDesc{
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ResourceManagerServiceClient interface {
BranchCommunicate(ctx context.Context, opts ...grpc.CallOption) (ResourceManagerService_BranchCommunicateClient, error)
BranchRegister(ctx context.Context, in *BranchRegisterRequest, opts ...grpc.CallOption) (*BranchRegisterResponse, error)
BranchReport(ctx context.Context, in *BranchReportRequest, opts ...grpc.CallOption) (*BranchReportResponse, error)
LockQuery(ctx context.Context, in *GlobalLockQueryRequest, opts ...grpc.CallOption) (*GlobalLockQueryResponse, error)
@@ -259,6 +260,37 @@ func NewResourceManagerServiceClient(cc grpc.ClientConnInterface) ResourceManage
return &resourceManagerServiceClient{cc}
}

func (c *resourceManagerServiceClient) BranchCommunicate(ctx context.Context, opts ...grpc.CallOption) (ResourceManagerService_BranchCommunicateClient, error) {
stream, err := c.cc.NewStream(ctx, &ResourceManagerService_ServiceDesc.Streams[0], "/apis.ResourceManagerService/BranchCommunicate", opts...)
if err != nil {
return nil, err
}
x := &resourceManagerServiceBranchCommunicateClient{stream}
return x, nil
}

type ResourceManagerService_BranchCommunicateClient interface {
Send(*BranchMessage) error
Recv() (*BranchMessage, error)
grpc.ClientStream
}

type resourceManagerServiceBranchCommunicateClient struct {
grpc.ClientStream
}

func (x *resourceManagerServiceBranchCommunicateClient) Send(m *BranchMessage) error {
return x.ClientStream.SendMsg(m)
}

func (x *resourceManagerServiceBranchCommunicateClient) Recv() (*BranchMessage, error) {
m := new(BranchMessage)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}

func (c *resourceManagerServiceClient) BranchRegister(ctx context.Context, in *BranchRegisterRequest, opts ...grpc.CallOption) (*BranchRegisterResponse, error) {
out := new(BranchRegisterResponse)
err := c.cc.Invoke(ctx, "/apis.ResourceManagerService/BranchRegister", in, out, opts...)
@@ -290,6 +322,7 @@ func (c *resourceManagerServiceClient) LockQuery(ctx context.Context, in *Global
// All implementations should embed UnimplementedResourceManagerServiceServer
// for forward compatibility
type ResourceManagerServiceServer interface {
BranchCommunicate(ResourceManagerService_BranchCommunicateServer) error
BranchRegister(context.Context, *BranchRegisterRequest) (*BranchRegisterResponse, error)
BranchReport(context.Context, *BranchReportRequest) (*BranchReportResponse, error)
LockQuery(context.Context, *GlobalLockQueryRequest) (*GlobalLockQueryResponse, error)
@@ -299,6 +332,9 @@ type ResourceManagerServiceServer interface {
type UnimplementedResourceManagerServiceServer struct {
}

func (UnimplementedResourceManagerServiceServer) BranchCommunicate(ResourceManagerService_BranchCommunicateServer) error {
return status.Errorf(codes.Unimplemented, "method BranchCommunicate not implemented")
}
func (UnimplementedResourceManagerServiceServer) BranchRegister(context.Context, *BranchRegisterRequest) (*BranchRegisterResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BranchRegister not implemented")
}
@@ -320,6 +356,32 @@ func RegisterResourceManagerServiceServer(s grpc.ServiceRegistrar, srv ResourceM
s.RegisterService(&ResourceManagerService_ServiceDesc, srv)
}

func _ResourceManagerService_BranchCommunicate_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(ResourceManagerServiceServer).BranchCommunicate(&resourceManagerServiceBranchCommunicateServer{stream})
}

type ResourceManagerService_BranchCommunicateServer interface {
Send(*BranchMessage) error
Recv() (*BranchMessage, error)
grpc.ServerStream
}

type resourceManagerServiceBranchCommunicateServer struct {
grpc.ServerStream
}

func (x *resourceManagerServiceBranchCommunicateServer) Send(m *BranchMessage) error {
return x.ServerStream.SendMsg(m)
}

func (x *resourceManagerServiceBranchCommunicateServer) Recv() (*BranchMessage, error) {
m := new(BranchMessage)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}

func _ResourceManagerService_BranchRegister_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BranchRegisterRequest)
if err := dec(in); err != nil {
@@ -394,126 +456,13 @@ var ResourceManagerService_ServiceDesc = grpc.ServiceDesc{
Handler: _ResourceManagerService_LockQuery_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "seata.proto",
}

// BranchTransactionServiceClient is the client API for BranchTransactionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type BranchTransactionServiceClient interface {
BranchCommit(ctx context.Context, in *BranchCommitRequest, opts ...grpc.CallOption) (*BranchCommitResponse, error)
BranchRollback(ctx context.Context, in *BranchRollbackRequest, opts ...grpc.CallOption) (*BranchRollbackResponse, error)
}

type branchTransactionServiceClient struct {
cc grpc.ClientConnInterface
}

func NewBranchTransactionServiceClient(cc grpc.ClientConnInterface) BranchTransactionServiceClient {
return &branchTransactionServiceClient{cc}
}

func (c *branchTransactionServiceClient) BranchCommit(ctx context.Context, in *BranchCommitRequest, opts ...grpc.CallOption) (*BranchCommitResponse, error) {
out := new(BranchCommitResponse)
err := c.cc.Invoke(ctx, "/apis.BranchTransactionService/BranchCommit", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

func (c *branchTransactionServiceClient) BranchRollback(ctx context.Context, in *BranchRollbackRequest, opts ...grpc.CallOption) (*BranchRollbackResponse, error) {
out := new(BranchRollbackResponse)
err := c.cc.Invoke(ctx, "/apis.BranchTransactionService/BranchRollback", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}

// BranchTransactionServiceServer is the server API for BranchTransactionService service.
// All implementations should embed UnimplementedBranchTransactionServiceServer
// for forward compatibility
type BranchTransactionServiceServer interface {
BranchCommit(context.Context, *BranchCommitRequest) (*BranchCommitResponse, error)
BranchRollback(context.Context, *BranchRollbackRequest) (*BranchRollbackResponse, error)
}

// UnimplementedBranchTransactionServiceServer should be embedded to have forward compatible implementations.
type UnimplementedBranchTransactionServiceServer struct {
}

func (UnimplementedBranchTransactionServiceServer) BranchCommit(context.Context, *BranchCommitRequest) (*BranchCommitResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BranchCommit not implemented")
}
func (UnimplementedBranchTransactionServiceServer) BranchRollback(context.Context, *BranchRollbackRequest) (*BranchRollbackResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BranchRollback not implemented")
}

// UnsafeBranchTransactionServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BranchTransactionServiceServer will
// result in compilation errors.
type UnsafeBranchTransactionServiceServer interface {
mustEmbedUnimplementedBranchTransactionServiceServer()
}

func RegisterBranchTransactionServiceServer(s grpc.ServiceRegistrar, srv BranchTransactionServiceServer) {
s.RegisterService(&BranchTransactionService_ServiceDesc, srv)
}

func _BranchTransactionService_BranchCommit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BranchCommitRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BranchTransactionServiceServer).BranchCommit(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/apis.BranchTransactionService/BranchCommit",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BranchTransactionServiceServer).BranchCommit(ctx, req.(*BranchCommitRequest))
}
return interceptor(ctx, in, info, handler)
}

func _BranchTransactionService_BranchRollback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BranchRollbackRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BranchTransactionServiceServer).BranchRollback(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/apis.BranchTransactionService/BranchRollback",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BranchTransactionServiceServer).BranchRollback(ctx, req.(*BranchRollbackRequest))
}
return interceptor(ctx, in, info, handler)
}

// BranchTransactionService_ServiceDesc is the grpc.ServiceDesc for BranchTransactionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var BranchTransactionService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "apis.BranchTransactionService",
HandlerType: (*BranchTransactionServiceServer)(nil),
Methods: []grpc.MethodDesc{
Streams: []grpc.StreamDesc{
{
MethodName: "BranchCommit",
Handler: _BranchTransactionService_BranchCommit_Handler,
},
{
MethodName: "BranchRollback",
Handler: _BranchTransactionService_BranchRollback_Handler,
StreamName: "BranchCommunicate",
Handler: _ResourceManagerService_BranchCommunicate_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "seata.proto",
}

+ 3
- 3
pkg/client/base/context/root_context.go View File

@@ -30,9 +30,9 @@ func NewRootContext(ctx context.Context) *RootContext {
localMap: make(map[string]interface{}),
}

kXID := ctx.Value(KeyXID)
if kXID != nil {
xid := kXID.(string)
xID := ctx.Value(KeyXID)
if xID != nil {
xid := xID.(string)
rootCtx.Bind(xid)
}
return rootCtx


+ 0
- 18
pkg/client/client.go View File

@@ -1,9 +1,7 @@
package client

import (
"fmt"
"log"
"net"

"google.golang.org/grpc"

@@ -12,7 +10,6 @@ import (
"github.com/opentrx/seata-golang/v2/pkg/client/rm"
"github.com/opentrx/seata-golang/v2/pkg/client/tcc"
"github.com/opentrx/seata-golang/v2/pkg/client/tm"
"github.com/opentrx/seata-golang/v2/pkg/util/runtime"
)

// Init init resource manager,init transaction manager, expose a port to listen tc
@@ -31,19 +28,4 @@ func Init(config *config.Configuration) {
rm.InitResourceManager(config.Addressing, resourceManagerClient)
tm.InitTransactionManager(config.Addressing, transactionManagerClient)
rm.RegisterTransactionServiceServer(tcc.GetTCCResourceManager())

lis, err := net.Listen("tcp", fmt.Sprintf(":%v", config.Port))
if err != nil {
log.Fatalf("failed to listen: %v", err)
}

s := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(config.GetEnforcementPolicy()),
grpc.KeepaliveParams(config.GetServerParameters()))
apis.RegisterBranchTransactionServiceServer(s, rm.GetResourceManager())

runtime.GoWithRecover(func() {
if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err)
}
}, nil)
}

+ 9
- 68
pkg/client/config/configuration.go View File

@@ -16,7 +16,6 @@ var configuration *Configuration

// Configuration client configuration
type Configuration struct {
Port int32 `yaml:"port" json:"port"`
Addressing string `yaml:"addressing" json:"addressing"`
ServerAddressing string `yaml:"serverAddressing" json:"serverAddressing"`

@@ -24,19 +23,6 @@ type Configuration struct {

ATConfig ATConfig `yaml:"at" json:"at,omitempty"`

EnforcementPolicy struct {
MinTime time.Duration `yaml:"minTime"`
PermitWithoutStream bool `yaml:"permitWithoutStream"`
} `yaml:"enforcementPolicy"`

ServerParameters struct {
MaxConnectionIdle time.Duration `yaml:"maxConnectionIdle"`
MaxConnectionAge time.Duration `yaml:"maxConnectionAge"`
MaxConnectionAgeGrace time.Duration `yaml:"maxConnectionAgeGrace"`
Time time.Duration `yaml:"time"`
Timeout time.Duration `yaml:"timeout"`
} `yaml:"serverParameters"`

ClientParameters struct {
Time time.Duration `yaml:"time"`
Timeout time.Duration `yaml:"timeout"`
@@ -44,8 +30,8 @@ type Configuration struct {
} `yaml:"clientParameters"`

Log struct {
LogPath string `yaml:"logPath"`
LogLevel log.LogLevel `yaml:"logLevel"`
LogPath string `yaml:"logPath"`
LogLevel log.Level `yaml:"logLevel"`
} `yaml:"log"`
}

@@ -74,61 +60,11 @@ func GetATConfig() ATConfig {
return configuration.ATConfig
}

// GetEnforcementPolicy used to config grpc connection keep alive
func GetEnforcementPolicy() keepalive.EnforcementPolicy {
return configuration.GetEnforcementPolicy()
}

// GetServerParameters used to config grpc connection keep alive
func GetServerParameters() keepalive.ServerParameters {
return configuration.GetServerParameters()
}

// GetClientParameters used to config grpc connection keep alive
func GetClientParameters() keepalive.ClientParameters {
return configuration.GetClientParameters()
}

// GetEnforcementPolicy used to config grpc connection keep alive
func (configuration *Configuration) GetEnforcementPolicy() keepalive.EnforcementPolicy {
ep := keepalive.EnforcementPolicy{
MinTime: 5 * time.Second,
PermitWithoutStream: true,
}
if configuration.EnforcementPolicy.MinTime > 0 {
ep.MinTime = configuration.EnforcementPolicy.MinTime
}
ep.PermitWithoutStream = configuration.EnforcementPolicy.PermitWithoutStream
return ep
}

// GetServerParameters used to config grpc connection keep alive
func (configuration *Configuration) GetServerParameters() keepalive.ServerParameters {
sp := keepalive.ServerParameters{
MaxConnectionIdle: 15 * time.Second,
MaxConnectionAge: 30 * time.Second,
MaxConnectionAgeGrace: 5 * time.Second,
Time: 5 * time.Second,
Timeout: time.Second,
}
if configuration.ServerParameters.MaxConnectionIdle > 0 {
sp.MaxConnectionIdle = configuration.ServerParameters.MaxConnectionIdle
}
if configuration.ServerParameters.MaxConnectionAge > 0 {
sp.MaxConnectionAge = configuration.ServerParameters.MaxConnectionAge
}
if configuration.ServerParameters.MaxConnectionAgeGrace > 0 {
sp.MaxConnectionAgeGrace = configuration.ServerParameters.MaxConnectionAgeGrace
}
if configuration.ServerParameters.Time > 0 {
sp.Time = configuration.ServerParameters.Time
}
if configuration.ServerParameters.Timeout > 0 {
sp.Timeout = configuration.ServerParameters.Timeout
}
return sp
}

// GetClientParameters used to config grpc connection keep alive
func (configuration *Configuration) GetClientParameters() keepalive.ClientParameters {
cp := keepalive.ClientParameters{
@@ -176,13 +112,18 @@ func InitConfiguration(configurationPath string) *Configuration {
log.Fatalf("open configuration file fail, %v", err)
}

defer fp.Close()

config, err := parse(fp)
if err != nil {
log.Fatalf("error parsing %s: %v", configurationPath, err)
}

defer func() {
err = fp.Close()
if err != nil {
log.Error(err)
}
}()

configuration = config
return configuration
}

+ 3
- 7
pkg/client/proxy/service.go View File

@@ -12,10 +12,6 @@ import (
)

var (
// Precompute the reflect type for error. Can't use error directly
// because Typeof takes an empty interface value. This is annoying.
typeOfError = reflect.TypeOf((*error)(nil)).Elem()

// serviceDescriptorMap, string -> *ServiceDescriptor
serviceDescriptorMap = sync.Map{}
)
@@ -36,7 +32,7 @@ type ServiceDescriptor struct {
Name string
ReflectType reflect.Type
ReflectValue reflect.Value
Methods sync.Map //string -> *MethodDescriptor
Methods sync.Map // string -> *MethodDescriptor
}

// Register
@@ -144,7 +140,7 @@ func Invoke(methodDesc *MethodDescriptor, ctx *ctx.RootContext, args []interface
for i := 0; i < len(args); i++ {
t := reflect.ValueOf(args[i])
if methodDesc.ArgsType[i].String() == "context.Context" {
t = SuiteContext(methodDesc, ctx)
t = SuiteContext(ctx, methodDesc)
}
if !t.IsValid() {
at := methodDesc.ArgsType[i]
@@ -161,7 +157,7 @@ func Invoke(methodDesc *MethodDescriptor, ctx *ctx.RootContext, args []interface
return returnValues
}

func SuiteContext(methodDesc *MethodDescriptor, ctx context.Context) reflect.Value {
func SuiteContext(ctx context.Context, methodDesc *MethodDescriptor) reflect.Value {
if contextValue := reflect.ValueOf(ctx); contextValue.IsValid() {
return contextValue
}


+ 119
- 23
pkg/client/rm/resource_manager.go View File

@@ -3,51 +3,64 @@ package rm
import (
"context"
"fmt"
"io"

"github.com/gogo/protobuf/types"
"github.com/opentrx/seata-golang/v2/pkg/apis"
"github.com/opentrx/seata-golang/v2/pkg/client/base/exception"
"github.com/opentrx/seata-golang/v2/pkg/client/base/model"
"github.com/opentrx/seata-golang/v2/pkg/util/log"
"github.com/opentrx/seata-golang/v2/pkg/util/runtime"
"google.golang.org/grpc/metadata"
)

var defaultResourceManager *ResourceManager

type ResourceManagerOutbound interface {
// Branch register long.
// BranchRegister register branch transaction.
BranchRegister(ctx context.Context, xid string, resourceID string, branchType apis.BranchSession_BranchType,
applicationData []byte, lockKeys string) (int64, error)

// Branch report.
// BranchReport report branch transaction status.
BranchReport(ctx context.Context, xid string, branchID int64, branchType apis.BranchSession_BranchType,
status apis.BranchSession_BranchStatus, applicationData []byte) error

// Lock query boolean.
// LockQuery lock resource by lockKeys.
LockQuery(ctx context.Context, xid string, resourceID string, branchType apis.BranchSession_BranchType, lockKeys string) (bool, error)
}

type ResourceManagerInterface interface {
apis.BranchTransactionServiceServer
BranchCommit(ctx context.Context, request *apis.BranchCommitRequest) (*apis.BranchCommitResponse, error)

BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error)

// Register a Resource to be managed by Resource Manager.
// RegisterResource Register a Resource to be managed by Resource Manager.
RegisterResource(resource model.Resource)

// Unregister a Resource from the Resource Manager.
// UnregisterResource Unregister a Resource from the Resource Manager.
UnregisterResource(resource model.Resource)

// Get the BranchType.
// GetBranchType ...
GetBranchType() apis.BranchSession_BranchType
}

type ResourceManager struct {
addressing string
rpcClient apis.ResourceManagerServiceClient
managers map[apis.BranchSession_BranchType]ResourceManagerInterface
addressing string
rpcClient apis.ResourceManagerServiceClient
managers map[apis.BranchSession_BranchType]ResourceManagerInterface
branchMessages chan *apis.BranchMessage
}

func InitResourceManager(addressing string, client apis.ResourceManagerServiceClient) {
defaultResourceManager = &ResourceManager{
addressing: addressing,
rpcClient: client,
managers: make(map[apis.BranchSession_BranchType]ResourceManagerInterface),
addressing: addressing,
rpcClient: client,
managers: make(map[apis.BranchSession_BranchType]ResourceManagerInterface),
branchMessages: make(chan *apis.BranchMessage),
}
runtime.GoWithRecover(func() {
defaultResourceManager.branchCommunicate()
}, nil)
}

func RegisterTransactionServiceServer(rm ResourceManagerInterface) {
@@ -58,6 +71,91 @@ func GetResourceManager() *ResourceManager {
return defaultResourceManager
}

func (manager *ResourceManager) branchCommunicate() {
for {
ctx := metadata.AppendToOutgoingContext(context.Background(), "addressing", manager.addressing)
stream, err := manager.rpcClient.BranchCommunicate(ctx)
if err != nil {
continue
}

done := make(chan bool)
runtime.GoWithRecover(func() {
for {
select {
case _, ok := <-done:
if !ok {
return
}
case msg := <-manager.branchMessages:
err := stream.Send(msg)
if err != nil {
return
}
default:
continue
}
}
}, nil)

for {
msg, err := stream.Recv()
if err == io.EOF {
close(done)
break
}
if err != nil {
close(done)
break
}
switch msg.BranchMessageType {
case apis.TypeBranchCommit:
request := &apis.BranchCommitRequest{}
data := msg.GetMessage().GetValue()
err := request.Unmarshal(data)
if err != nil {
log.Error(err)
continue
}
response, err := manager.BranchCommit(context.Background(), request)
if err == nil {
content, err := types.MarshalAny(response)
if err == nil {
manager.branchMessages <- &apis.BranchMessage{
ID: msg.ID,
BranchMessageType: apis.TypeBranchCommitResult,
Message: content,
}
}
}
case apis.TypeBranchRollback:
request := &apis.BranchRollbackRequest{}
data := msg.GetMessage().GetValue()
err := request.Unmarshal(data)
if err != nil {
log.Error(err)
continue
}
response, err := manager.BranchRollback(context.Background(), request)
if err == nil {
content, err := types.MarshalAny(response)
if err == nil {
manager.branchMessages <- &apis.BranchMessage{
ID: msg.ID,
BranchMessageType: apis.TypeBranchRollBackResult,
Message: content,
}
}
}
}
}
err = stream.CloseSend()
if err != nil {
log.Error(err)
}
}
}

func (manager *ResourceManager) BranchRegister(ctx context.Context, xid string, resourceID string,
branchType apis.BranchSession_BranchType, applicationData []byte, lockKeys string) (int64, error) {
request := &apis.BranchRegisterRequest{
@@ -74,11 +172,10 @@ func (manager *ResourceManager) BranchRegister(ctx context.Context, xid string,
}
if resp.ResultCode == apis.ResultCodeSuccess {
return resp.BranchID, nil
} else {
return 0, &exception.TransactionException{
Code: resp.GetExceptionCode(),
Message: resp.GetMessage(),
}
}
return 0, &exception.TransactionException{
Code: resp.GetExceptionCode(),
Message: resp.GetMessage(),
}
}

@@ -119,11 +216,10 @@ func (manager *ResourceManager) LockQuery(ctx context.Context, xid string, resou
}
if resp.ResultCode == apis.ResultCodeSuccess {
return resp.Lockable, nil
} else {
return false, &exception.TransactionException{
Code: resp.GetExceptionCode(),
Message: resp.GetMessage(),
}
}
return false, &exception.TransactionException{
Code: resp.GetExceptionCode(),
Message: resp.GetMessage(),
}
}



+ 28
- 28
pkg/client/tcc/proxy.go View File

@@ -2,36 +2,36 @@ package tcc

import (
"encoding/json"
"github.com/opentrx/seata-golang/v2/pkg/apis"
"github.com/opentrx/seata-golang/v2/pkg/client/rm"
"reflect"
"strconv"

gxnet "github.com/dubbogo/gost/net"
"github.com/pkg/errors"

"github.com/opentrx/seata-golang/v2/pkg/apis"
ctx "github.com/opentrx/seata-golang/v2/pkg/client/base/context"
"github.com/opentrx/seata-golang/v2/pkg/client/proxy"
"github.com/opentrx/seata-golang/v2/pkg/client/rm"
"github.com/opentrx/seata-golang/v2/pkg/util/log"
"github.com/opentrx/seata-golang/v2/pkg/util/time"
)

var (
TCC_ACTION_NAME = "TccActionName"
TccActionName = "TccActionName"

TRY_METHOD = "Try"
CONFIRM_METHOD = "Confirm"
CANCEL_METHOD = "Cancel"
TryMethod = "Try"
ConfirmMethod = "Confirm"
CancelMethod = "Cancel"

ACTION_START_TIME = "action-start-time"
ACTION_NAME = "actionName"
PREPARE_METHOD = "sys::prepare"
COMMIT_METHOD = "sys::commit"
ROLLBACK_METHOD = "sys::rollback"
HOST_NAME = "host-name"
ActionStartTime = "action-start-time"
ActionName = "actionName"
PrepareMethod = "sys::prepare"
CommitMethod = "sys::commit"
RollbackMethod = "sys::rollback"
HostName = "host-name"

TCC_METHOD_ARGUMENTS = "arguments"
TCC_METHOD_RESULT = "result"
TccMethodArguments = "arguments"
TccMethodResult = "result"

businessActionContextType = reflect.TypeOf(&ctx.BusinessActionContext{})
)
@@ -82,26 +82,26 @@ func ImplementTCC(v TccProxyService) {
t := typeOf.Field(i)
methodName := t.Name
f := valueOfElem.Field(i)
if f.Kind() == reflect.Func && f.IsValid() && f.CanSet() && methodName == TRY_METHOD {
if f.Kind() == reflect.Func && f.IsValid() && f.CanSet() && methodName == TryMethod {
if t.Type.NumIn() != 1 && t.Type.In(0) != businessActionContextType {
panic("prepare method argument is not BusinessActionContext")
}

actionName := t.Tag.Get(TCC_ACTION_NAME)
actionName := t.Tag.Get(TccActionName)
if actionName == "" {
panic("must tag TccActionName")
}

commitMethodDesc := proxy.Register(proxyService, CONFIRM_METHOD)
cancelMethodDesc := proxy.Register(proxyService, CANCEL_METHOD)
commitMethodDesc := proxy.Register(proxyService, ConfirmMethod)
cancelMethodDesc := proxy.Register(proxyService, CancelMethod)
tryMethodDesc := proxy.Register(proxyService, methodName)

tccResource := &TCCResource{
ActionName: actionName,
PrepareMethodName: TRY_METHOD,
CommitMethodName: COMMIT_METHOD,
PrepareMethodName: TryMethod,
CommitMethodName: CommitMethod,
CommitMethod: commitMethodDesc,
RollbackMethodName: CANCEL_METHOD,
RollbackMethodName: CancelMethod,
RollbackMethod: cancelMethodDesc,
}

@@ -139,20 +139,20 @@ func proceed(methodDesc *proxy.MethodDescriptor, ctx *ctx.BusinessActionContext,
}

func doTccActionLogStore(ctx *ctx.BusinessActionContext, resource *TCCResource) (int64, error) {
ctx.ActionContext[ACTION_START_TIME] = time.CurrentTimeMillis()
ctx.ActionContext[PREPARE_METHOD] = resource.PrepareMethodName
ctx.ActionContext[COMMIT_METHOD] = resource.CommitMethodName
ctx.ActionContext[ROLLBACK_METHOD] = resource.RollbackMethodName
ctx.ActionContext[ACTION_NAME] = ctx.ActionName
ctx.ActionContext[ActionStartTime] = time.CurrentTimeMillis()
ctx.ActionContext[PrepareMethod] = resource.PrepareMethodName
ctx.ActionContext[CommitMethod] = resource.CommitMethodName
ctx.ActionContext[RollbackMethod] = resource.RollbackMethodName
ctx.ActionContext[ActionName] = ctx.ActionName
ip, err := gxnet.GetLocalIP()
if err == nil {
ctx.ActionContext[HOST_NAME] = ip
ctx.ActionContext[HostName] = ip
} else {
log.Warn("getLocalIP error")
}

applicationContext := make(map[string]interface{})
applicationContext[TCC_ACTION_CONTEXT] = ctx.ActionContext
applicationContext[TccActionContext] = ctx.ActionContext

applicationData, err := json.Marshal(applicationContext)
if err != nil {


+ 16
- 18
pkg/client/tcc/tcc_resource_manager.go View File

@@ -14,7 +14,7 @@ import (
)

var (
TCC_ACTION_CONTEXT = "actionContext"
TccActionContext = "actionContext"
)

var tccResourceManager TCCResourceManager
@@ -55,7 +55,7 @@ func (resourceManager TCCResourceManager) BranchCommit(ctx context.Context, requ
args = append(args, businessActionContext)
returnValues := proxy.Invoke(tccResource.CommitMethod, nil, args)
log.Debugf("TCC resource commit result : %v, xid: %s, branchID: %d, resourceID: %s", returnValues, request.XID, request.BranchID, request.ResourceID)
if returnValues != nil && len(returnValues) == 1 {
if len(returnValues) == 1 {
result = returnValues[0].Interface().(bool)
}
if result {
@@ -65,14 +65,13 @@ func (resourceManager TCCResourceManager) BranchCommit(ctx context.Context, requ
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoCommitted,
}, nil
} else {
return &apis.BranchCommitResponse{
ResultCode: apis.ResultCodeSuccess,
XID: request.XID,
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoCommitFailedRetryable,
}, nil
}
return &apis.BranchCommitResponse{
ResultCode: apis.ResultCodeSuccess,
XID: request.XID,
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoCommitFailedRetryable,
}, nil
}

func (resourceManager TCCResourceManager) BranchRollback(ctx context.Context, request *apis.BranchRollbackRequest) (*apis.BranchRollbackResponse, error) {
@@ -97,7 +96,7 @@ func (resourceManager TCCResourceManager) BranchRollback(ctx context.Context, re
args = append(args, businessActionContext)
returnValues := proxy.Invoke(tccResource.RollbackMethod, nil, args)
log.Debugf("TCC resource rollback result : %v, xid: %s, branchID: %d, resourceID: %s", returnValues, request.XID, request.BranchID, request.ResourceID)
if returnValues != nil && len(returnValues) == 1 {
if len(returnValues) == 1 {
result = returnValues[0].Interface().(bool)
}
if result {
@@ -107,14 +106,13 @@ func (resourceManager TCCResourceManager) BranchRollback(ctx context.Context, re
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoRolledBack,
}, nil
} else {
return &apis.BranchRollbackResponse{
ResultCode: apis.ResultCodeSuccess,
XID: request.XID,
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoRollbackFailedRetryable,
}, nil
}
return &apis.BranchRollbackResponse{
ResultCode: apis.ResultCodeSuccess,
XID: request.XID,
BranchID: request.BranchID,
BranchStatus: apis.PhaseTwoRollbackFailedRetryable,
}, nil
}

func getBusinessActionContext(xid string, branchID int64, resourceID string, applicationData []byte) *ctx.BusinessActionContext {
@@ -129,7 +127,7 @@ func getBusinessActionContext(xid string, branchID int64, resourceID string, app
}
}

acMap := tccContext[TCC_ACTION_CONTEXT]
acMap := tccContext[TccActionContext]
if acMap != nil {
actionContextMap = acMap.(map[string]interface{})
}


+ 4
- 4
pkg/client/tm/global_transaction.go View File

@@ -12,8 +12,8 @@ import (
)

const (
DEFAULT_GLOBAL_TX_TIMEOUT = 60000
DEFAULT_GLOBAL_TX_NAME = "default"
DefaultGlobalTxTimeout = 60000
DefaultGlobalTxName = "default"
)

type SuspendedResourcesHolder struct {
@@ -64,11 +64,11 @@ type DefaultGlobalTransaction struct {
}

func (gtx *DefaultGlobalTransaction) Begin(ctx *ctx.RootContext) error {
return gtx.BeginWithTimeout(DEFAULT_GLOBAL_TX_TIMEOUT, ctx)
return gtx.BeginWithTimeout(DefaultGlobalTxTimeout, ctx)
}

func (gtx *DefaultGlobalTransaction) BeginWithTimeout(timeout int32, ctx *ctx.RootContext) error {
return gtx.BeginWithTimeoutAndName(timeout, DEFAULT_GLOBAL_TX_NAME, ctx)
return gtx.BeginWithTimeoutAndName(timeout, DefaultGlobalTxName, ctx)
}

func (gtx *DefaultGlobalTransaction) BeginWithTimeoutAndName(timeout int32, name string, ctx *ctx.RootContext) error {


+ 12
- 14
pkg/client/tm/proxy.go View File

@@ -12,8 +12,6 @@ import (
"github.com/opentrx/seata-golang/v2/pkg/util/log"
)

import ()

type GlobalTransactionProxyService interface {
GetProxyService() interface{}
GetMethodTransactionInfo(methodName string) *model.TransactionInfo
@@ -40,8 +38,8 @@ func Implement(v GlobalTransactionProxyService) {
makeCallProxy := func(methodDesc *proxy.MethodDescriptor, txInfo *model.TransactionInfo) func(in []reflect.Value) []reflect.Value {
return func(in []reflect.Value) []reflect.Value {
var (
args = make([]interface{}, 0)
returnValues = make([]reflect.Value, 0)
args []interface{}
returnValues []reflect.Value
suspendedResourcesHolder *SuspendedResourcesHolder
)

@@ -68,14 +66,17 @@ func Implement(v GlobalTransactionProxyService) {
}

tx := GetCurrentOrCreate(invCtx)
defer tx.Resume(suspendedResourcesHolder, invCtx)
defer func() {
err := tx.Resume(suspendedResourcesHolder, invCtx)
if err != nil {
log.Error(err)
}
}()

switch txInfo.Propagation {
case model.Required:
break
case model.RequiresNew:
suspendedResourcesHolder, _ = tx.Suspend(true, invCtx)
break
case model.NotSupported:
suspendedResourcesHolder, _ = tx.Suspend(true, invCtx)
returnValues = proxy.Invoke(methodDesc, invCtx, args)
@@ -85,19 +86,16 @@ func Implement(v GlobalTransactionProxyService) {
returnValues = proxy.Invoke(methodDesc, invCtx, args)
return returnValues
}
break
case model.Never:
if invCtx.InGlobalTransaction() {
return proxy.ReturnWithError(methodDesc, errors.Errorf("Existing transaction found for transaction marked with propagation 'never',xid = %s", invCtx.GetXID()))
} else {
returnValues = proxy.Invoke(methodDesc, invCtx, args)
return returnValues
}
returnValues = proxy.Invoke(methodDesc, invCtx, args)
return returnValues
case model.Mandatory:
if !invCtx.InGlobalTransaction() {
return proxy.ReturnWithError(methodDesc, errors.New("No existing transaction found for transaction marked with propagation 'mandatory'"))
}
break
default:
return proxy.ReturnWithError(methodDesc, errors.Errorf("Not Supported Propagation: %s", txInfo.Propagation.String()))
}
@@ -111,13 +109,13 @@ func Implement(v GlobalTransactionProxyService) {

errValue := returnValues[len(returnValues)-1]

//todo 只要出错就回滚,未来可以优化一下,某些错误才回滚,某些错误的情况下,可以提交
// todo 只要出错就回滚,未来可以优化一下,某些错误才回滚,某些错误的情况下,可以提交
if errValue.IsValid() && !errValue.IsNil() {
rollbackErr := tx.Rollback(invCtx)
if rollbackErr != nil {
return proxy.ReturnWithError(methodDesc, errors.WithStack(rollbackErr))
}
return proxy.ReturnWithError(methodDesc, errors.New("rollback failure"))
return returnValues
}

commitErr := tx.Commit(invCtx)


+ 1
- 1
pkg/client/tm/transaction_manager.go View File

@@ -2,9 +2,9 @@ package tm

import (
"context"
"github.com/opentrx/seata-golang/v2/pkg/client/base/exception"

"github.com/opentrx/seata-golang/v2/pkg/apis"
"github.com/opentrx/seata-golang/v2/pkg/client/base/exception"
)

var defaultTransactionManager *TransactionManager


+ 19
- 0
pkg/common/message_future.go View File

@@ -0,0 +1,19 @@
package common

import "github.com/opentrx/seata-golang/v2/pkg/apis"

// MessageFuture ...
type MessageFuture struct {
ID int64
Err error
Response interface{}
Done chan bool
}

// NewMessageFuture ...
func NewMessageFuture(message *apis.BranchMessage) *MessageFuture {
return &MessageFuture{
ID: message.ID,
Done: make(chan bool),
}
}

+ 4
- 24
pkg/tc/config/configuration.go View File

@@ -29,6 +29,8 @@ type Configuration struct {
CommittingRetryPeriod time.Duration `yaml:"committingRetryPeriod"`
RollingBackRetryPeriod time.Duration `yaml:"rollingBackRetryPeriod"`
TimeoutRetryPeriod time.Duration `yaml:"timeoutRetryPeriod"`

StreamMessageTimeout time.Duration `yaml:"streamMessageTimeout"`
} `yaml:"server"`

EnforcementPolicy struct {
@@ -44,18 +46,12 @@ type Configuration struct {
Timeout time.Duration `yaml:"timeout"`
} `yaml:"serverParameters"`

ClientParameters struct {
Time time.Duration `yaml:"time"`
Timeout time.Duration `yaml:"timeout"`
PermitWithoutStream bool `yaml:"permitWithoutStream"`
} `yaml:"clientParameters"`

// Storage is the configuration for the storage driver
Storage Storage `yaml:"storage"`

Log struct {
LogPath string `yaml:"logPath"`
LogLevel log.LogLevel `yaml:"logLevel"`
LogPath string `yaml:"logPath"`
LogLevel log.Level `yaml:"logLevel"`
} `yaml:"log"`
}

@@ -97,22 +93,6 @@ func (configuration *Configuration) GetServerParameters() keepalive.ServerParame
return sp
}

func (configuration *Configuration) GetClientParameters() keepalive.ClientParameters {
cp := keepalive.ClientParameters{
Time: 10 * time.Second,
Timeout: time.Second,
PermitWithoutStream: true,
}
if configuration.ClientParameters.Time > 0 {
cp.Time = configuration.ClientParameters.Timeout
}
if configuration.ClientParameters.Timeout > 0 {
cp.Timeout = configuration.ClientParameters.Timeout
}
cp.PermitWithoutStream = configuration.ClientParameters.PermitWithoutStream
return cp
}

// Parameters defines a key-value parameters mapping
type Parameters map[string]interface{}



+ 41
- 21
pkg/tc/holder/session_holder.go View File

@@ -27,7 +27,7 @@ func (holder *SessionHolder) FindGlobalTransaction(xid string) *model.GlobalTran
if globalSession != nil {
gt := &model.GlobalTransaction{GlobalSession: globalSession}
branchSessions := holder.manager.FindBranchSessions(xid)
if branchSessions != nil && len(branchSessions) != 0 {
if len(branchSessions) != 0 {
gt.BranchSessions = make(map[*apis.BranchSession]bool, len(branchSessions))
for i := 0; i < len(branchSessions); i++ {
gt.BranchSessions[branchSessions[i]] = true
@@ -38,32 +38,42 @@ func (holder *SessionHolder) FindGlobalTransaction(xid string) *model.GlobalTran
return nil
}

func (holder *SessionHolder) FindAsyncCommittingGlobalTransactions() []*model.GlobalTransaction {
return holder.findGlobalTransactions([]apis.GlobalSession_GlobalStatus{
func (holder *SessionHolder) FindAsyncCommittingGlobalTransactions(addressingIdentities []string) []*model.GlobalTransaction {
return holder.findGlobalTransactionsWithAddressingIdentities([]apis.GlobalSession_GlobalStatus{
apis.AsyncCommitting,
})
}, addressingIdentities)
}

func (holder *SessionHolder) FindRetryCommittingGlobalTransactions() []*model.GlobalTransaction {
return holder.findGlobalTransactions([]apis.GlobalSession_GlobalStatus{
func (holder *SessionHolder) FindRetryCommittingGlobalTransactions(addressingIdentities []string) []*model.GlobalTransaction {
return holder.findGlobalTransactionsWithAddressingIdentities([]apis.GlobalSession_GlobalStatus{
apis.CommitRetrying,
})
}, addressingIdentities)
}

func (holder *SessionHolder) FindRetryRollbackGlobalTransactions() []*model.GlobalTransaction {
return holder.findGlobalTransactions([]apis.GlobalSession_GlobalStatus{
func (holder *SessionHolder) FindRetryRollbackGlobalTransactions(addressingIdentities []string) []*model.GlobalTransaction {
return holder.findGlobalTransactionsWithAddressingIdentities([]apis.GlobalSession_GlobalStatus{
apis.RollingBack, apis.RollbackRetrying, apis.TimeoutRollingBack, apis.TimeoutRollbackRetrying,
})
}, addressingIdentities)
}

func (holder *SessionHolder) findGlobalTransactions(statuses []apis.GlobalSession_GlobalStatus) []*model.GlobalTransaction {
gts := holder.manager.FindGlobalSessions(statuses)
if gts == nil || len(gts) == 0 {
return holder.findGlobalTransactionsByGlobalSessions(gts)
}

func (holder *SessionHolder) findGlobalTransactionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus,
addressingIdentities []string) []*model.GlobalTransaction {
gts := holder.manager.FindGlobalSessionsWithAddressingIdentities(statuses, addressingIdentities)
return holder.findGlobalTransactionsByGlobalSessions(gts)
}

func (holder *SessionHolder) findGlobalTransactionsByGlobalSessions(sessions []*apis.GlobalSession) []*model.GlobalTransaction {
if len(sessions) == 0 {
return nil
}

xids := make([]string, 0, len(gts))
for _, gt := range gts {
xids := make([]string, 0, len(sessions))
for _, gt := range sessions {
xids = append(xids, gt.XID)
}
branchSessions := holder.manager.FindBatchBranchSessions(xids)
@@ -80,15 +90,15 @@ func (holder *SessionHolder) findGlobalTransactions(statuses []apis.GlobalSessio
}
}

globalTransactions := make([]*model.GlobalTransaction, 0, len(gts))
for j := 0; j < len(gts); j++ {
globalTransactions := make([]*model.GlobalTransaction, 0, len(sessions))
for j := 0; j < len(sessions); j++ {
globalTransaction := &model.GlobalTransaction{
GlobalSession: gts[j],
BranchSessions: make(map[*apis.BranchSession]bool, 0),
GlobalSession: sessions[j],
BranchSessions: map[*apis.BranchSession]bool{},
}

branchSessionSlice := branchSessionMap[gts[j].XID]
if branchSessionSlice != nil && len(branchSessionSlice) > 0 {
branchSessionSlice := branchSessionMap[sessions[j].XID]
if len(branchSessionSlice) > 0 {
for x := 0; x < len(branchSessionSlice); x++ {
globalTransaction.BranchSessions[branchSessionSlice[x]] = true
}
@@ -99,6 +109,10 @@ func (holder *SessionHolder) findGlobalTransactions(statuses []apis.GlobalSessio
return globalTransactions
}

func (holder *SessionHolder) FindGlobalSessions(statuses []apis.GlobalSession_GlobalStatus) []*apis.GlobalSession {
return holder.manager.FindGlobalSessions(statuses)
}

func (holder *SessionHolder) AllSessions() []*apis.GlobalSession {
return holder.manager.AllSessions()
}
@@ -118,9 +132,15 @@ func (holder *SessionHolder) RemoveGlobalSession(session *apis.GlobalSession) er
}

func (holder *SessionHolder) RemoveGlobalTransaction(globalTransaction *model.GlobalTransaction) error {
holder.manager.RemoveGlobalSession(globalTransaction.GlobalSession)
err := holder.manager.RemoveGlobalSession(globalTransaction.GlobalSession)
if err != nil {
return err
}
for bs := range globalTransaction.BranchSessions {
holder.manager.RemoveBranchSession(globalTransaction.GlobalSession, bs)
err = holder.manager.RemoveBranchSession(globalTransaction.GlobalSession, bs)
if err != nil {
return err
}
}
return nil
}


+ 2
- 2
pkg/tc/lock/lock_manager.go View File

@@ -26,7 +26,7 @@ func (locker *LockManager) AcquireLock(branchSession *apis.BranchSession) bool {
}

locks := storage.CollectBranchSessionRowLocks(branchSession)
if locks == nil || len(locks) == 0 {
if len(locks) == 0 {
return true
}

@@ -44,7 +44,7 @@ func (locker *LockManager) ReleaseLock(branchSession *apis.BranchSession) bool {
}

locks := storage.CollectBranchSessionRowLocks(branchSession)
if locks == nil || len(locks) == 0 {
if len(locks) == 0 {
return true
}



+ 73
- 80
pkg/tc/metrics/metrics.go View File

@@ -1,57 +1,57 @@
package metrics

import (
"github.com/opentrx/seata-golang/v2/pkg/apis"
"sort"

"github.com/rcrowley/go-metrics"

"github.com/opentrx/seata-golang/v2/pkg/apis"
"github.com/opentrx/seata-golang/v2/pkg/tc/event"
"github.com/opentrx/seata-golang/v2/pkg/util/runtime"
)

var (
SEATA_TRANSACTION = "seata.transaction"
SeataTransaction = "seata.transaction"

NAME_KEY = "name"
NameKey = "name"

ROLE_KEY = "role"
RoleKey = "role"

METER_KEY = "meter"
MeterKey = "meter"

STATISTIC_KEY = "statistic"
StatisticKey = "statistic"

STATUS_KEY = "status"
StatusKey = "status"

ROLE_VALUE_TC = "tc"
RoleValueTc = "tc"

ROLE_VALUE_TM = "client"
RoleValueTm = "client"

ROLE_VALUE_RM = "rm"
RoleValueRm = "rm"

METER_VALUE_GAUGE = "gauge"
MeterValueGauge = "gauge"

METER_VALUE_COUNTER = "counter"
MeterValueCounter = "counter"

METER_VALUE_SUMMARY = "summary"
MeterValueSummary = "summary"

METER_VALUE_TIMER = "timer"
MeterValueTimer = "timer"

STATISTIC_VALUE_COUNT = "count"
StatisticValueCount = "count"

STATISTIC_VALUE_TOTAL = "total"
StatisticValueTotal = "total"

STATISTIC_VALUE_TPS = "tps"
StatisticValueTps = "tps"

STATISTIC_VALUE_MAX = "max"
StatisticValueMax = "max"

STATISTIC_VALUE_AVERAGE = "average"
StatisticValueAverage = "average"

STATUS_VALUE_ACTIVE = "active"
StatusValueActive = "active"

STATUS_VALUE_COMMITTED = "committed"
StatusValueCommitted = "committed"

STATUS_VALUE_ROLLBACKED = "rollbacked"
StatusValueRollbacked = "rollbacked"
)

type Counter struct {
@@ -122,105 +122,98 @@ func sortedLabels(labels map[string]string) (keys, values []string) {
}

var (
COUNTER_ACTIVE = &Counter{
CounterActive = &Counter{
Counter: metrics.NewCounter(),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_COUNTER,
STATUS_KEY: STATUS_VALUE_ACTIVE,
RoleKey: RoleValueTc,
MeterKey: MeterValueCounter,
StatusKey: StatusValueActive,
},
}
COUNTER_COMMITTED = &Counter{
CounterCommitted = &Counter{
Counter: metrics.NewCounter(),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_COUNTER,
STATUS_KEY: STATUS_VALUE_COMMITTED,
RoleKey: RoleValueTc,
MeterKey: MeterValueCounter,
StatusKey: StatusValueCommitted,
},
}
COUNTER_ROLLBACKED = &Counter{
CounterRollbacked = &Counter{
Counter: metrics.NewCounter(),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_COUNTER,
STATUS_KEY: STATUS_VALUE_ROLLBACKED,
RoleKey: RoleValueTc,
MeterKey: MeterValueCounter,
StatusKey: StatusValueRollbacked,
},
}
SUMMARY_COMMITTED = &Summary{
SummaryCommitted = &Summary{
Meter: metrics.NewMeter(),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_SUMMARY,
STATUS_KEY: STATUS_VALUE_COMMITTED,
RoleKey: RoleValueTc,
MeterKey: MeterValueSummary,
StatusKey: StatusValueCommitted,
},
}
SUMMARY_ROLLBACKED = &Summary{
SummaryRollbacked = &Summary{
Meter: metrics.NewMeter(),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_SUMMARY,
STATUS_KEY: STATUS_VALUE_ROLLBACKED,
RoleKey: RoleValueTc,
MeterKey: MeterValueSummary,
StatusKey: StatusValueRollbacked,
},
}
TIMER_COMMITTED = &Histogram{
TimerCommitted = &Histogram{
Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_TIMER,
STATUS_KEY: STATUS_VALUE_COMMITTED,
RoleKey: RoleValueTc,
MeterKey: MeterValueTimer,
StatusKey: StatusValueCommitted,
},
}
TIMER_ROLLBACK = &Histogram{
TimerRollback = &Histogram{
Histogram: metrics.NewHistogram(metrics.NewExpDecaySample(1028, 0.015)),
Name: SEATA_TRANSACTION,
Name: SeataTransaction,
Labels: map[string]string{
ROLE_KEY: ROLE_VALUE_TC,
METER_KEY: METER_VALUE_TIMER,
STATUS_KEY: STATUS_VALUE_ROLLBACKED,
RoleKey: RoleValueTc,
MeterKey: MeterValueTimer,
StatusKey: StatusValueRollbacked,
},
}
)

type MetricsSubscriber struct {
type Subscriber struct {
}

func (subscriber *MetricsSubscriber) ProcessGlobalTransactionEvent() {
func (subscriber *Subscriber) ProcessGlobalTransactionEvent() {
for {
gtv := <-event.EventBus.GlobalTransactionEventChannel
switch gtv.GetStatus() {
case apis.Begin:
COUNTER_ACTIVE.Inc(1)
break
CounterActive.Inc(1)
case apis.Committed:
COUNTER_ACTIVE.Dec(1)
COUNTER_COMMITTED.Inc(1)
SUMMARY_COMMITTED.Mark(1)
TIMER_COMMITTED.Update(gtv.GetEndTime() - gtv.GetBeginTime())
break
CounterActive.Dec(1)
CounterCommitted.Inc(1)
SummaryCommitted.Mark(1)
TimerCommitted.Update(gtv.GetEndTime() - gtv.GetBeginTime())
case apis.RolledBack:
COUNTER_ACTIVE.Dec(1)
COUNTER_ROLLBACKED.Inc(1)
SUMMARY_ROLLBACKED.Mark(1)
TIMER_ROLLBACK.Update(gtv.GetEndTime() - gtv.GetBeginTime())
break
CounterActive.Dec(1)
CounterRollbacked.Inc(1)
SummaryRollbacked.Mark(1)
TimerRollback.Update(gtv.GetEndTime() - gtv.GetBeginTime())
case apis.CommitFailed:
COUNTER_ACTIVE.Dec(1)
break
CounterActive.Dec(1)
case apis.RollbackFailed:
COUNTER_ACTIVE.Dec(1)
break
CounterActive.Dec(1)
case apis.TimeoutRolledBack:
COUNTER_ACTIVE.Dec(1)
break
CounterActive.Dec(1)
case apis.TimeoutRollbackFailed:
COUNTER_ACTIVE.Dec(1)
break
CounterActive.Dec(1)
default:
break
}
@@ -228,7 +221,7 @@ func (subscriber *MetricsSubscriber) ProcessGlobalTransactionEvent() {
}

func init() {
subscriber := &MetricsSubscriber{}
subscriber := &Subscriber{}
runtime.GoWithRecover(func() {
subscriber.ProcessGlobalTransactionEvent()
}, nil)


+ 20
- 11
pkg/tc/metrics/promethues_exporter.go View File

@@ -7,33 +7,37 @@ import (
"strconv"
"strings"

"github.com/opentrx/seata-golang/v2/pkg/util/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)

type promHttpExporter struct {
type promHTTPExporter struct {
real http.Handler
}

func (exporter *promHttpExporter) ServeHTTP(rsp http.ResponseWriter, req *http.Request) {
func (exporter *promHTTPExporter) ServeHTTP(rsp http.ResponseWriter, req *http.Request) {
exporter.real.ServeHTTP(rsp, req)

exporter.Flush(rsp)
}

func (exporter *promHttpExporter) Flush(writer io.Writer) {
func (exporter *promHTTPExporter) Flush(writer io.Writer) {
w := writer
var sb strings.Builder
tracker := make(map[string]bool)

flushCounter(tracker, &sb, COUNTER_ACTIVE)
flushCounter(tracker, &sb, COUNTER_COMMITTED)
flushCounter(tracker, &sb, COUNTER_ROLLBACKED)
flushCounter(tracker, &sb, CounterActive)
flushCounter(tracker, &sb, CounterCommitted)
flushCounter(tracker, &sb, CounterRollbacked)

flushHistogram(tracker, &sb, TIMER_COMMITTED)
flushHistogram(tracker, &sb, TIMER_ROLLBACK)
flushHistogram(tracker, &sb, TimerCommitted)
flushHistogram(tracker, &sb, TimerRollback)

w.Write([]byte(sb.String()))
_, err := w.Write([]byte(sb.String()))
if err != nil {
log.Error(err)
}
}

func flushHistogram(tracker map[string]bool, buf *strings.Builder, histogram *Histogram) {
@@ -105,7 +109,7 @@ func init() {

// export http for prometheus
srvMux := http.NewServeMux()
srvMux.Handle("/metrics", &promHttpExporter{
srvMux.Handle("/metrics", &promHTTPExporter{
real: promhttp.HandlerFor(promReg, promhttp.HandlerOpts{
DisableCompression: true,
}),
@@ -115,5 +119,10 @@ func init() {
Addr: fmt.Sprintf("0.0.0.0:%d", 9898),
Handler: srvMux,
}
go srv.ListenAndServe()
go func() {
err := srv.ListenAndServe()
if err != nil {
log.Error(err)
}
}()
}

+ 0
- 2
pkg/tc/model/global_transaction.go View File

@@ -42,8 +42,6 @@ func (gt *GlobalTransaction) IsSaga() bool {
for branchSession := range gt.BranchSessions {
if branchSession.Type == apis.SAGA {
return true
} else {
return false
}
}
return false


+ 37
- 0
pkg/tc/server/callback_message_queue.go View File

@@ -0,0 +1,37 @@
package server

import (
"sync"

"github.com/opentrx/seata-golang/v2/pkg/apis"
)

type CallbackMessageQueue struct {
lock *sync.Mutex

queue []*apis.BranchMessage
}

func NewCallbackMessageQueue() *CallbackMessageQueue {
return &CallbackMessageQueue{
queue: make([]*apis.BranchMessage, 0),
lock: &sync.Mutex{},
}
}

func (p *CallbackMessageQueue) Enqueue(msg *apis.BranchMessage) {
p.lock.Lock()
defer p.lock.Unlock()
p.queue = append(p.queue, msg)
}

func (p *CallbackMessageQueue) Dequeue() *apis.BranchMessage {
p.lock.Lock()
defer p.lock.Unlock()
if len(p.queue) == 0 {
return nil
}
var msg *apis.BranchMessage
msg, p.queue = p.queue[0], p.queue[1:]
return msg
}

+ 2
- 1
pkg/tc/server/global_session_locker.go View File

@@ -1,8 +1,9 @@
package server

import (
"github.com/opentrx/seata-golang/v2/pkg/apis"
"time"

"github.com/opentrx/seata-golang/v2/pkg/apis"
)

type GlobalSessionLocker interface {


+ 484
- 257
pkg/tc/server/transaction_coordinator.go
File diff suppressed because it is too large
View File


+ 7
- 7
pkg/tc/storage/driver/factory/factory.go View File

@@ -10,15 +10,15 @@ import (
// factories
var driverFactories = make(map[string]StorageDriverFactory)

// StorageDriverFactory is a factory interface for creating storage.StorageDriver interfaces
// StorageDriverFactory is a factory interface for creating storage.Driver interfaces
// Storage drivers should call Register() with a factory to make the driver available by name.
// Individual StorageDriver implementations generally register with the factory via the Register
// Individual Driver implementations generally register with the factory via the Register
// func (below) in their init() funcs, and as such they should be imported anonymously before use.
type StorageDriverFactory interface {
// Create returns a new storage.StorageDriver with the given parameters
// Create returns a new storage.Driver with the given parameters
// Parameters will vary by driver and may be ignored
// Each parameter key must only consist of lowercase letters and numbers
Create(parameters map[string]interface{}) (storage.StorageDriver, error)
Create(parameters map[string]interface{}) (storage.Driver, error)
}

// Register makes a storage driver available by the provided name.
@@ -37,11 +37,11 @@ func Register(name string, factory StorageDriverFactory) {
driverFactories[name] = factory
}

// Create a new storage.StorageDriver with the given name and
// Create a new storage.Driver with the given name and
// parameters. To use a driver, the StorageDriverFactory must first be
// registered with the given name. If no drivers are found, an
// InvalidStorageDriverError is returned
func Create(name string, parameters map[string]interface{}) (storage.StorageDriver, error) {
func Create(name string, parameters map[string]interface{}) (storage.Driver, error) {
driverFactory, ok := driverFactories[name]
if !ok {
return nil, InvalidStorageDriverError{name}
@@ -55,5 +55,5 @@ type InvalidStorageDriverError struct {
}

func (err InvalidStorageDriverError) Error() string {
return fmt.Sprintf("StorageDriver not registered: %s", err.Name)
return fmt.Sprintf("Driver not registered: %s", err.Name)
}

pkg/tc/storage/driver/in_memory/inmemory.go → pkg/tc/storage/driver/inmemory/inmemory.go View File

@@ -1,4 +1,4 @@
package in_memory
package inmemory

import (
"fmt"
@@ -9,7 +9,6 @@ import (
"github.com/opentrx/seata-golang/v2/pkg/tc/storage"
"github.com/opentrx/seata-golang/v2/pkg/tc/storage/driver/factory"
"github.com/opentrx/seata-golang/v2/pkg/util/log"

)

func init() {
@@ -19,7 +18,7 @@ func init() {
// inMemoryFactory implements the factory.StorageDriverFactory interface
type inMemoryFactory struct{}

func (factory *inMemoryFactory) Create(parameters map[string]interface{}) (storage.StorageDriver, error) {
func (factory *inMemoryFactory) Create(parameters map[string]interface{}) (storage.Driver, error) {
return &driver{
SessionMap: &sync.Map{},
LockMap: &sync.Map{},
@@ -73,6 +72,36 @@ func (driver *driver) FindGlobalSessions(statuses []apis.GlobalSession_GlobalSta
return sessions
}

// Find global sessions list with addressing identities
func (driver *driver) FindGlobalSessionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus,
addressingIdentities []string) []*apis.GlobalSession {
contain := func(statuses []apis.GlobalSession_GlobalStatus, status apis.GlobalSession_GlobalStatus) bool {
for _, s := range statuses {
if s == status {
return true
}
}
return false
}
containAddressing := func(addressingIdentities []string, addressing string) bool {
for _, s := range addressingIdentities {
if s == addressing {
return true
}
}
return false
}
var sessions = make([]*apis.GlobalSession, 0)
driver.SessionMap.Range(func(key, value interface{}) bool {
session := value.(*model.GlobalTransaction)
if contain(statuses, session.Status) && containAddressing(addressingIdentities, session.Addressing) {
sessions = append(sessions, session.GlobalSession)
}
return true
})
return sessions
}

// All sessions collection.
func (driver *driver) AllSessions() []*apis.GlobalSession {
var sessions = make([]*apis.GlobalSession, 0)

+ 26
- 7
pkg/tc/storage/driver/mysql/mysql.go View File

@@ -6,7 +6,7 @@ import (
"strings"
"time"

_ "github.com/go-sql-driver/mysql"
_ "github.com/go-sql-driver/mysql" // register mysql
"github.com/go-xorm/xorm"
"xorm.io/builder"

@@ -18,10 +18,10 @@ import (
)

const (
InsertGlobalTransaction = `insert into %s (addressing, xid, transaction_id, transaction_name, timeout, begin_time,
InsertGlobalTransaction = `insert into %s (addressing, xid, transaction_id, transaction_name, timeout, begin_time,
status, active, gmt_create, gmt_modified) values(?, ?, ?, ?, ?, ?, ?, ?, now(), now())`

QueryGlobalTransactionByXid = `select addressing, xid, transaction_id, transaction_name, timeout, begin_time,
QueryGlobalTransactionByXid = `select addressing, xid, transaction_id, transaction_name, timeout, begin_time,
status, active, gmt_create, gmt_modified from %s where xid = ?`

UpdateGlobalTransaction = "update %s set status = ?, gmt_modified = now() where xid = ?"
@@ -43,7 +43,7 @@ const (

DeleteBranchTransaction = "delete from %s where xid = ? and branch_id = ?"

InsertRowLock = `insert into %s (xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create,
InsertRowLock = `insert into %s (xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create,
gmt_modified) values %s`

QueryRowKey = `select xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create, gmt_modified
@@ -68,7 +68,7 @@ type DriverParameters struct {
// mysqlFactory implements the factory.StorageDriverFactory interface
type mysqlFactory struct{}

func (factory *mysqlFactory) Create(parameters map[string]interface{}) (storage.StorageDriver, error) {
func (factory *mysqlFactory) Create(parameters map[string]interface{}) (storage.Driver, error) {
return FromParameters(parameters)
}

@@ -80,7 +80,7 @@ type driver struct {
queryLimit int
}

func FromParameters(parameters map[string]interface{}) (storage.StorageDriver, error) {
func FromParameters(parameters map[string]interface{}) (storage.Driver, error) {
dsn := parameters["dsn"]
if dsn == nil {
dsn = ""
@@ -184,7 +184,7 @@ func FromParameters(parameters map[string]interface{}) (storage.StorageDriver, e
}

// New constructs a new Driver
func New(params DriverParameters) (storage.StorageDriver, error) {
func New(params DriverParameters) (storage.Driver, error) {
if params.DSN == "" {
return nil, fmt.Errorf("the dsn parameter should not be empty")
}
@@ -242,11 +242,30 @@ func (driver *driver) FindGlobalSessions(statuses []apis.GlobalSession_GlobalSta
return globalSessions
}

// Find global sessions list with addressing identities
func (driver *driver) FindGlobalSessionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus,
addressingIdentities []string) []*apis.GlobalSession {
var globalSessions []*apis.GlobalSession
err := driver.engine.Table(driver.globalTable).
Where(builder.
In("status", statuses).
And(builder.In("addressing", addressingIdentities))).
OrderBy("gmt_modified").
Limit(driver.queryLimit).
Find(&globalSessions)

if err != nil {
log.Errorf(err.Error())
}
return globalSessions
}

// All sessions collection.
func (driver *driver) AllSessions() []*apis.GlobalSession {
var globalSessions []*apis.GlobalSession
err := driver.engine.Table(driver.globalTable).
OrderBy("gmt_modified").
Limit(driver.queryLimit).
Find(&globalSessions)

if err != nil {


+ 25
- 7
pkg/tc/storage/driver/pgsql/pgsql.go View File

@@ -7,7 +7,7 @@ import (
"time"

"github.com/go-xorm/xorm"
_ "github.com/lib/pq"
_ "github.com/lib/pq" // register pg
"xorm.io/builder"

"github.com/opentrx/seata-golang/v2/pkg/apis"
@@ -18,10 +18,10 @@ import (
)

const (
InsertGlobalTransaction = `insert into %s (addressing, xid, transaction_id, transaction_name, timeout, begin_time,
InsertGlobalTransaction = `insert into %s (addressing, xid, transaction_id, transaction_name, timeout, begin_time,
status, active, gmt_create, gmt_modified) values($1, $2, $3, $4, $5, $6, $7, $8, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)`

QueryGlobalTransactionByXid = `select addressing, xid, transaction_id, transaction_name, timeout, begin_time,
QueryGlobalTransactionByXid = `select addressing, xid, transaction_id, transaction_name, timeout, begin_time,
status, active, gmt_create, gmt_modified from %s where xid = $1`

UpdateGlobalTransaction = "update %s set status = $1, gmt_modified = CURRENT_TIMESTAMP where xid = $2"
@@ -43,7 +43,7 @@ const (

DeleteBranchTransaction = "delete from %s where xid = $1 and branch_id = $2"

InsertRowLock = `insert into %s (xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create,
InsertRowLock = `insert into %s (xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create,
gmt_modified) values %s`

QueryRowKey = `select xid, transaction_id, branch_id, resource_id, table_name, pk, row_key, gmt_create, gmt_modified
@@ -68,7 +68,7 @@ type DriverParameters struct {
// pgsqlFactory implements the factory.StorageDriverFactory interface
type pgsqlFactory struct{}

func (factory *pgsqlFactory) Create(parameters map[string]interface{}) (storage.StorageDriver, error) {
func (factory *pgsqlFactory) Create(parameters map[string]interface{}) (storage.Driver, error) {
return FromParameters(parameters)
}

@@ -80,7 +80,7 @@ type driver struct {
queryLimit int
}

func FromParameters(parameters map[string]interface{}) (storage.StorageDriver, error) {
func FromParameters(parameters map[string]interface{}) (storage.Driver, error) {
dsn := parameters["dsn"]
if dsn == nil {
dsn = ""
@@ -184,7 +184,7 @@ func FromParameters(parameters map[string]interface{}) (storage.StorageDriver, e
}

// New constructs a new Driver
func New(params DriverParameters) (storage.StorageDriver, error) {
func New(params DriverParameters) (storage.Driver, error) {
if params.DSN == "" {
return nil, fmt.Errorf("the dsn parameter should not be empty")
}
@@ -242,6 +242,24 @@ func (driver *driver) FindGlobalSessions(statuses []apis.GlobalSession_GlobalSta
return globalSessions
}

// Find global sessions list with addressing identities
func (driver *driver) FindGlobalSessionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus,
addressingIdentities []string) []*apis.GlobalSession {
var globalSessions []*apis.GlobalSession
err := driver.engine.Table(driver.globalTable).
Where(builder.
In("status", statuses).
And(builder.In("addressing", addressingIdentities))).
OrderBy("gmt_modified").
Limit(driver.queryLimit).
Find(&globalSessions)

if err != nil {
log.Errorf(err.Error())
}
return globalSessions
}

// All sessions collection.
func (driver *driver) AllSessions() []*apis.GlobalSession {
var globalSessions []*apis.GlobalSession


+ 1
- 1
pkg/tc/storage/row_locker.go View File

@@ -8,7 +8,7 @@ import (
"github.com/opentrx/seata-golang/v2/pkg/util/common"
)

const LOCK_SPLIT = "^^^"
const LockSplit = "^^^"

func CollectBranchSessionRowLocks(branchSession *apis.BranchSession) []*apis.RowLock {
if branchSession == nil || branchSession.LockKey == "" {


+ 4
- 1
pkg/tc/storage/storagedriver.go View File

@@ -15,6 +15,9 @@ type SessionManager interface {
// Find global sessions list.
FindGlobalSessions(statuses []apis.GlobalSession_GlobalStatus) []*apis.GlobalSession

// Find global sessions list with addressing identities
FindGlobalSessionsWithAddressingIdentities(statuses []apis.GlobalSession_GlobalStatus, addressingIdentities []string) []*apis.GlobalSession

// All sessions collection.
AllSessions() []*apis.GlobalSession

@@ -54,7 +57,7 @@ type LockManager interface {
IsLockable(xid string, resourceID string, lockKey string) bool
}

type StorageDriver interface {
type Driver interface {
SessionManager
LockManager
}

+ 10
- 10
pkg/util/log/logging.go View File

@@ -11,27 +11,27 @@ import (
)

// Level represents the level of logging.
type LogLevel int8
type Level int8

const (
// DebugLevel logs are typically voluminous, and are usually disabled in
// production.
DebugLevel = LogLevel(zapcore.DebugLevel)
DebugLevel = Level(zapcore.DebugLevel)
// InfoLevel is the default logging priority.
InfoLevel = LogLevel(zapcore.InfoLevel)
InfoLevel = Level(zapcore.InfoLevel)
// WarnLevel logs are more important than Info, but don't need individual
// human review.
WarnLevel = LogLevel(zapcore.WarnLevel)
WarnLevel = Level(zapcore.WarnLevel)
// ErrorLevel logs are high-priority. If an application is running smoothly,
// it shouldn't generate any error-level logs.
ErrorLevel = LogLevel(zapcore.ErrorLevel)
ErrorLevel = Level(zapcore.ErrorLevel)
// PanicLevel logs a message, then panics.
PanicLevel = LogLevel(zapcore.PanicLevel)
PanicLevel = Level(zapcore.PanicLevel)
// FatalLevel logs a message, then calls os.Exit(1).
FatalLevel = LogLevel(zapcore.FatalLevel)
FatalLevel = Level(zapcore.FatalLevel)
)

func (l *LogLevel) UnmarshalText(text []byte) error {
func (l *Level) UnmarshalText(text []byte) error {
if l == nil {
return errors.New("can't unmarshal a nil *Level")
}
@@ -41,7 +41,7 @@ func (l *LogLevel) UnmarshalText(text []byte) error {
return nil
}

func (l *LogLevel) unmarshalText(text []byte) bool {
func (l *Level) unmarshalText(text []byte) bool {
switch string(text) {
case "debug", "DEBUG":
*l = DebugLevel
@@ -106,7 +106,7 @@ func init() {
log = zapLogger.Sugar()
}

func Init(logPath string, level LogLevel) {
func Init(logPath string, level Level) {
lumberJackLogger := &lumberjack.Logger{
Filename: logPath,
MaxSize: 10,


+ 1
- 2
pkg/util/mysql/mysql_keyword_checker.go View File

@@ -287,7 +287,6 @@ func CheckEscape(fieldOrTableName string) bool {
func CheckAndReplace(fieldOrTableName string) string {
if Check(fieldOrTableName) {
return "`" + fieldOrTableName + "`"
} else {
return fieldOrTableName
}
return fieldOrTableName
}

+ 9
- 9
pkg/util/sql/sql_type.go View File

@@ -4,10 +4,10 @@ import "strings"

// refer to [Types](java.sql.Types)

type SqlType int32
type Type int32

const (
BIT SqlType = -7
BIT Type = -7

TINYINT = -6

@@ -49,7 +49,7 @@ const (

OTHER = 1111

JAVA_OBJECT = 2000
JavaObject = 2000

DISTINCT = 2001

@@ -79,14 +79,14 @@ const (

SQLXML = 2009

REF_CURSOR = 2012
RefCursor = 2012

TIME_WITH_TIMEZONE = 2013
TimeWithTimezone = 2013

TIMESTAMP_WITH_TIMEZONE = 2014
TimestampWithTimezone = 2014
)

var SqlTypes = map[string]int32{
var SQLTypes = map[string]int32{
"BIT": -7,
"TINYINT": -6,
"SMALLINT": 5,
@@ -128,6 +128,6 @@ var SqlTypes = map[string]int32{
"TIMESTAMP_WITH_TIMEZONE": 2014,
}

func GetSqlType(dataType string) int32 {
return SqlTypes[strings.ToUpper(dataType)]
func GetSQLType(dataType string) int32 {
return SQLTypes[strings.ToUpper(dataType)]
}

+ 2
- 2
pkg/util/uuid/id_worker.go View File

@@ -33,7 +33,7 @@ const (
// highest 11 bit: not used
// middle 41 bit: timestamp
// lowest 12 bit: sequence
var timestampAndSequence uint64 = 0
var timestampAndSequence uint64

// business meaning: machine ID (0 ~ 1023)
// actual layout in memory:
@@ -99,7 +99,7 @@ func generateWorkerIDBaseOnMac() (int64, error) {

mac := iface.HardwareAddr

return int64(int((mac[4]&0b11)<<8) | int(mac[5]&0xFF)), nil
return int64(int(rune(mac[4]&0b11)<<8) | int(mac[5]&0xFF)), nil
}
return 0, fmt.Errorf("no available mac found")
}


Loading…
Cancel
Save