incubator-seata
incubator-seata copied to clipboard
如何将globalSession.getReverseSortedBranches() fix到2.0.0
io.seata.server.coordinator.DefaultCore#doGlobalRollback中的 globalSession.getSortedBranches()需要修复成globalSession.getReverseSortedBranches();(这个已经在2.x中修复)
我计划自己修复后,自己重新打镜像。 由于2.0.0中没有修复这个bug,我自己2.0.0的源码,修改这样代码。使用教程中的命令打包,打出来的镜像与从镜像仓库拉下来的差别较大。
1. mvn -Prelease-seata -Dmaven.test.skip=true clean install -U
2. cd distribution/target/seata-server-2.0.0/seata/
3. docker build --no-cache --build-arg SEATA_VERSION=2.0.0 -t seata-server:2.0.0 .
问题: 1、是我使用的打包的命令不对么? 2、有其他办法在2.0.0中fix这个bug么? 下面是镜像内的内容 文字展示
root@e1e060c89509:/# pwd
/
root@e1e060c89509:/# ls
bin dev home lib64 media opt root sbin seata-server-entrypoint.sh srv tmp var
boot etc lib logs mnt proc run seata-server seata-setup.sh sys usr
root@e1e060c89509:/# ls seata-server
classes jib-classpath-file jib-main-class-file libs resources
root@e1e060c89509:/# ls seata-server/resources
META-INF README-zh.md README.md application.example.yml application.raft.example.yml application.yml banner.txt docker io logback logback-spring.xml lua
-- 本地镜像
# pwd
/
# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin seata-server srv sys tmp usr var
# ls seata-server
LICENSE bin conf ext lib logs target
下面是镜像内的内容 截图展示
官网镜像使用jib-maven-plugin插件打包,可以通过启用image profile使其生效,但需要调整部分参数。参考:https://github.com/apache/incubator-seata/blob/2.x/server/pom.xml#L342
The official image is packaged using the jib-maven-plugin plugin, which can be enabled by enabling image profile, but some parameters need to be adjusted. Reference: https://github.com/apache/incubator-seata/blob/2.x/server/pom.xml#L342
目前与提供的dockerfile打包确实差距较大,感兴趣可以提交pr使两边保持一致。
Currently there is a real gap with the provided Dockerfile packaging, interested in submitting pr to bring both sides in line.
1.切到这个修复后的commits的seata版本 2.mvn -Prelease-seata -Dmaven.test.skip=true clean install -U 3.到distribution运行 https://github.com/apache/incubator-seata/blob/2.x/distribution/Dockerfile
1.Cut to the seata version of this repaired commits 2.mvn -Prelease-seata -Dmaven.test.skip=true clean install -U 3. cd distribution https://github.com/apache/incubator-seata/blob/2.x/distribution/Dockerfile
1.切到这个修复后的commits的seata版本 2.mvn -Prelease-seata -Dmaven.test.skip=true clean install -U 3.到distribution运行 https://github.com/apache/incubator-seata/blob/2.x/distribution/Dockerfile
1.Cut to the seata version of this repaired commits 2.mvn -Prelease-seata -Dmaven.test.skip=true clean install -U 3. cd distribution https://github.com/apache/incubator-seata/blob/2.x/distribution/Dockerfile
根据上面的问题描述,目前他采用的应该就是这种方式。与官网镜像确实有差别。
Based on the description of the problem above, this should be the approach he is currently using. It does differ from the official site image.
目前我已经将新的镜像放到我的服务器并启动了,目前看起来是和官网的一样了。 但还是建议在1.7.0之后的版本hotfix这个问题,只要业务在同一个事物中多次操作数据,就会导致回滚失败 处理步骤如下:
1、将seata-server 下的pom.xml中的 jib-maven-plugin 节点下的 (修改build ->dockerBuild)
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
改为
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
2、cd server/ 3、build镜像,并推送到本地(如果需要推送到指定地址(如localhost:5000),需要添加 参数 -Dimage.name=localhost:5000/seata-server)
mvn package jib:dockerBuild -Prelease-image-based-on-java8,release-seata -DskipTests -Dimage.publish.skip=false -Dimage.tags=2.0.0.1
4、保存镜像到指定路径
docker save -o /Users/xxx/Downloads/seata-server-2.0.0.1.tar seata-server:2.0.0.1
5、将镜像文件上传到服务器
scp /Users/xxx/Downloads/seata-server-2.0.0.1.tar [email protected]:/data/images/seata
6、在服务器上load镜像
docker load -i seata-server-2.0.0.1.tar
7、重新部署seata应用