1.Can Seata be used in a production environment?
2.Dose Seata support high availability ?
3.What is the use of the record of undo log table log status = 1 ?
4.How to use the Seata framework to ensure transaction isolation?
5.When Failed to roll back dirty data, what shall I do ?
6.Why the global transaction state is not "begin" when a branch transaction is registered ?
10. Why didn't my mybatis operation return auto-generated ID?
11.I can't find this package:io.seata.codec.protobuf.generated,and cant't run seata server?
13.Support multiple primary keys?
14.How to solve the error reported by HikariDataSource?
16.How to package seata-server after modifying the source code?
17.What RPC frameworks does seata support now?
19. NoSuchMethodError in apache-dubbo 2.7.0?
20.What are the precautions for using AT mode?
22.What to note for the AT mode and Spring @Transactional annotation hyphenation?
23.Spring boot 1.5.x appear the Jackson related NoClassDefFoundException?
24.SpringCloud xid cannot transmit?
25.undo_log cannot be deleted after using the mybatis plus dynamic data source component?
26.Could not found global transaction xid = %s, may be has finished.
28.The database enables automatic update timestamp, which makes dirty data unable to be rolled back?
29.timeoutrollching occurs before the global transaction timeout?
30.What database and table splitting solutions does Seata support at this stage?
31.What are the restrictions on Seata's address registered with the registry?
A: Since version 0.4.2,it is supported in production environment,Users who are using seata are welcome to complete this issue together:who's using Seata
A: supported from version 0.6, tc USES db mode to share global transaction session information, and the registry USES non-file seata-supported third-party registries
A:
Scenario: after A branch transaction A registers TC, A global transaction rollback occurs before A local transaction commits
Consequence: global transaction rollback succeeds, a resource is occupied, resulting in resource suspension problem
Anti-suspension measures: when a rolls back and finds that the rollback undo has not been inserted, an undo record with log_status=1 is inserted. When a local transaction (business write operation SQL and corresponding undo are a local transaction) is committed, it fails due to the unique key conflict of the undo table.
A: Since seata phase 1 local transactions have been committed, enhanced isolation is needed to prevent other transactions from dirty reads and dirty writes.
note:If the interface of the business you are querying does not use the @GlobalTransactional annotation, which means there is no need for distributed transactions on the method, you can annotate the @globallock+@Transactional annotation on the method and add a for update statement to the query.
If your query interface has the @GlobalTransactional annotation on the outer edge of the transactional link, you can simply add a for update statement to your query. The reason for designing this annotation is that before it is available, distributed transactions need to query the committed data, but the business does not need distributed transactions.
Using the @GlobalTransactional annotation adds some unnecessary additional RPC overhead such as begin returning xid, commit transaction, etc. GlobalLock simplifies the RPC process for higher performance.
A:
node:It is recommended to isolate the dirty data in advance
A:
abnormal: Could not register branch into global session xid = status = Rollbacked(Two phase state and Rollbacking, AsyncCommitting, etc) while expecting Begin
describe: When a branch transaction is registered, the global transaction status must be a one-phase state "begin", and registration other than "begin" is not allowed. It belongs to the normal processing at the seata framework level, and users can solve it from their own business level.
This exception can occur in the following situations (you can continue to add).
A: abnormal:io.seata.common.exception.FrameworkException: can not register RM,err:can not connect to services-server.
configuration is the same as the project group configuration name.
note:1.Version 080 starts the specified IP problem, the exception "Exception in thread "main" java.lang.RuntimeException: java.net.BindException: Cannot assign request address", please upgrade to version 081 or above.
The project USES jdk13 and starts with
Error: Could not create the Java Virtual Machine
Error: A fatal exception has occurred. Program will exit.
If the environment is sh, replace the last paragraph in the script:
exec "$JAVACMD" $JAVA_OPTS -server -Xmx2048m -Xms2048m -Xmn1024m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:
MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="$BASEDIR"/logs
/java_heapdump.hprof -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+
UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -verbose:gc -Dio.netty.leakDetectionLevel=advanced \
-classpath "$CLASSPATH" \
-Dapp.name="seata-server" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dapp.home="$BASEDIR" \
-Dbasedir="$BASEDIR" \
io.seata.server.Server \
"$@"
A: Add the eureka-client.properties file in the seata\conf directory and add the Eureka properties to be overwritten. For example, to overwrite eureka.instance.lease-renewal-interval-in-seconds and eureka.instance.lease-expiration-duration-in-seconds, add the following:
eureka.lease.renewalInterval=1
eureka.lease.duration=2
The attribute prefix is eureka, and the subsequent attribute names can refer to the class com.netflix.appinfo.PropertyBasedInstanceConfigConstants. You can also study the seata-discovery-eureka project of the discovery module in the seata source code.
A: when the undolog serialization is configured as Jackson, the Jackson version needs to be 2.9.9+
A:
plan1.You should update the configuraton of mybatis
: set annotation @Options(useGeneratedKeys = true, keyProperty = "id")
or set the value of useGeneratedKeys and keyProperty in mybatis
xml configuraton
plan2.Delete the id field of the undo_log table
A:
You can execute this command: ./mvnw clean install -DskipTests=true
(Mac,Linux) or mvnw.cmd clean install -DskipTests=true
, (Win)reference issues/2438,These codes have been removed in version 0.8.1.
A:
Modify the driver configuration store.db.driver-class-name
of file.conf
;
Delete mysql5 driver and add mysql8 driver under lib directory
ps: The same is true for Oracle; 1.2.0
supports MySQL driver multi version isolation without adding drivers
A:
For the time being, only MySQL is supported. For other types of databases, it is recommended to create a column of self incremented ID primary keys first, and change the original composite primary keys to unique keys to avoid the problem.
A:
**Error1**:ClassCastException: com.sun.proxy.$Proxy153 cannot be cast to com.zaxxer.hikari.HikariDataSource
**Reason**:Instance type conversion error during automatic proxy, injected with $Proxy153 instance, not HikariDataSource's own or subclass instance.
**Solution**: The Seata automatic proxy data source function uses JDK proxy to proxy DataSource. The generated proxy class extends Proxy implements DataSource can be changed by the receiver to DataSource receive implementation.
1.1.0 will support both JDK proxy and cglib, and cglib will also be able to switch to solve the problem.
A:
At present, seata-all
needs to use conf type conf
files, and properties
and yml
type files will be supported later. At present, you can rely on seata-spring-boot-starter
in the project, and then write the configuration item to the application.properties
so that the conf type file is not used.
A:
bin
,conf
,and lib
directories of the distribution
module../mvnw clean install -DskipTests=true(Mac,Linux)
OR mvnw.cmd clean install -DskipTests=true(Win) -P release-seata
。distribution
module.mvn -Prelease-seata -Dmaven.test.skip=true clean install -U
A:
Dubbo, Spring Cloud, Motan, gRPC , sofa-RPC , EDAS-HSF and bRPC
A:
The dependent version of druid
needs to be upgraded to version 1.1.12 +
, and the default dependent version in Seata is 1.1.12
(provided).
A:
When apache-dubbo loads the filter, it will load the filter of Alibaba Dubbo together, and it will be found in com.alibaba.dubbo.rpc.invoker
in version 2.7.0
(Result invoke(org.apache.dubbo.rpc.Invocation invocation) throws RpcException;
), Misuse of org.apache.dubbo.rpc.invocation
to enter parameters (fixed in2.7.1
), resulting in java.lang.NoSuchMethodError: com.alibaba.dubbo.rpc.Invoker.invoke(Lcom/alibaba/dubbo/rpc/Invocation;)Lcom/alibaba/dubbo/rpc/Result;
So please upgrade dubbo
to 2.7.1
or above to ensure compatibility. It is alibaba-dubbo
and can be used safely. alibaba-dubbo
does not contain apache-dubbo
packages.
A:
seata-spring-boot-starter
, the data source is automatically proxied without additional processing.seata-all
, use @EnableAutoDatasourceProxy (since 1.1.0) annotation. JDK proxy or cglib proxy can be selected as annotation parameters.seata-all
, you can also manually wrap the DataSource with DatasourceProxy.GlobalTransactionScanner
, you need to configure it manually when using seata-all
, and no additional processing is required when using seata-spring-boot-starter
.Apache Dubbo, Alibaba Dubbo, sofa-RPC, Motan, gRpc, httpClient
, for support from Spring Cloud, please kindly cite spring-cloud-alibaba-seata
. Other self research framework, asynchronous model, message consumption transaction model please support itself in combination with the API.A:
It is currently known why the configuration will have a \r
, presumably because this file you write in win, so there are permutations to \r\n
, and then you execute it with git bash (this can be considered Linux) to recognize \n
permutations, so there is more \r
The solution is currently twofold:
sed -i ""s/\r//"" config.txt
vim
into the text with the command set fileformat = unix
(the pro test is available)
A:
@Transactional
can be coupled with DataSourceTransactionManager
and JTATransactionManager
to represent local transactions and XA distributed transactions, respectively. Common to everyone is the combination with local affairs.
When combined with local transactions@Transactial
and @GlobalTransactional
are hyphenated,@Transactial
can only be located in the same method hierarchy annotated at @GlobalTransaction
or within the inner layer of @GlobalTransaction
annotation methods.
Here the concept of distributed transactions is larger than local transactions, annotating @Transactional
outside results in a distributed transaction empty submission, a global transaction being submitted when the @Transactional
corresponding connection submission is declared or the XID of the global transaction is absent.
A:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.fasterxml.jackson.databind.ObjectMapper
It is currently found that too low a version of Jackson that was originally introduced in spring boot version 1.5.x, can cause Seata to rely on Jackson to find new features, Seata requires that the Jackson version 2.9.9+, but the use of the Jackson version 2.9.9 + version can cause the Jackson API used in spring boot to not find, and is a problem with forward compatibility in the Jackson itself. Therefore, it is recommended that you switch Seata's serialization to non Jackson serialization, such as kryo, with the configuration term client.undo.logSerialization = "kryo"
A:
spring-cloud-alibaba-seata
dependency.WebMvcConfigurer
. If yes, please refer to the method of com.alibaba.cloud.seata.web.seatahandlerinterceptorconfiguration#addinterceptors
. Add SeataHandlerInterceptor
to your interception linkA:
The dynamic-datasource-spring-boot-starter
component will automatically use DataSourceProxy
to wrap the DataSource
after opening Seata. Therefore, the following methods are required to maintain compatibility:
seata-all
, please do not use @EnableAutoDatasourceProxy annotationseata-spring-boot-starter
, please turn off the automatic agentseata:
enable-auto-data-source-proxy: false
A:
Examples:
@GlobalTransactional(timeout=60000) public void A(){
call remoting B();//Remote call B service local DB operation;
}
public void B(){
}
Possible causes:
The overall execution time of service A exceeds 60000ms, causing the global transaction to initiate a global rollback. At this time, method A or B continues to execute DB operation, verify the global transaction status, and find that the global transaction has been rolled back.
When service B executes the readTimeout beyond its setting, it returns an exception to a and throws the exception, causing the global transaction to be rolled back. At this time, when service B performs the DB operation, it verifies the global transaction status and finds that the global transaction has been rolled back.
Impact: in this case, the data will be rolled back to the initial state of the data before the execution of method A. from the perspective of data consistency, the data is consistent as a whole.
A:
This error is caused by the connection established by an abnormal Seata client (such as accessing the Seata server port through HTTP, port scanning of ECS, etc.). This connection does not send registration information and is considered a useless connection. This exception can be ignored.
A:
Due to the business submission, after Seata records the current image, the database updates the timestamp again, resulting in the failure of image verification.
Solution 1: Turn off automatic timestamp update of the database. The timestamp update of data, such as modification and creation time, is maintained at the code level. For example, MybatisPlus can automatically fill in.
**Solution 2:**UPDATE statement don't put the fields that haven't been updated into the update statement.
A:
It is recommended that the time zone of TC database be inconsistent with the time zone of DB database.
A:
Only shardingsphere is supported at this stage. With regard to the compatibility of sub-treasury and split-table with Seata, Seata supports a sub database and sub table scheme by requiring the sub-treasury and split-table framework team to provide an integrated compatibility scheme, rather than Seata. At present, Seata is communicating with each sub-treasury and split-table framework team to discuss the integration compatibility scheme.
A:
The Seata registry cannot register addresses of 0.0.0.0 or 127.0.0.1. When the address is automatically registered as the above address, you can start the parameter -h
or the container environment variable SEATA_IP
. When the and business services are on different networks, the registered address can be specified as NAT_IP
or public network IP
, but it is necessary to ensure that the health inspection activities of the registration center are unobstructed.
A:
This is due to the use of a higher version of JDK. The higher version of JDK cancels the CMS processor and replaces it with ZGC.
There are two solutions. Choose one of them:
Downgrade JDK version
Delete the JDK command of CMS in the startup script of Seata
A:
This is because the seata source code was compiled and then the local seata dependency package was overwritten. JDK 11 was used when compiling the seata source code. In JDK 11, the flip()
method was rewritten, resulting in incompatibility.
Solution: