-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
seata1.5.2主键中带有逗号导致获取全局锁lock key值错误 #5136
Comments
This bug has been on our radar before, but if it's fixed it won't be backwards compatible which is a problem, do you have any good ideas? |
可不可以把主键的分隔符做成可配置的,默认是逗号,如果有配置就按配置的 |
已在运行中的事务如何解决?贸然替换分隔符可能造成数据的脏写,导致无法回滚(如果业务侧没有抛业务上的异常,二阶段回滚概率不大倒是不影响)。 |
要做得严谨的话感觉要加版本号概念了 |
i feel best way to solve the problem is to encode the lock key, so user have no feel. to solve the compatible problem: in client: in server: |
@funky-eyes please help check the logic 😊, may be i can make another contribute , haha. |
I have two solutions. Using escape characters: On the client side, insert an escape character "" before the "," in primary keys containing ",". For example, "NextNumberBO:KS,D01" becomes "NextNumberBO:KS,D01". On the server side, when splitting, do not split on ",". On the client side, replace "," in the primary key with a rarely used symbol. On the server side, replace it back during processing. I believe these two solutions are compatible with previous versions. 我有两个方案。 1.使用转义符,在客户端,对于含有“,”的主键插入转义符“\”,例如,"NextNumberBO:KS,D01"--》"NextNumberBO:KS\,D01",在服务端切分的时候对于“\,”不进行切分 2.在客户端,将主键中的“,”替换为某个不常用的符号,在服务端处理时再替换回来 我认为这两个方案可以与以往版本兼容。 |
Ⅰ. Issue Description
主键中带有逗号,获取全局锁错误
Ⅱ. Describe what happened
seata日志:
Ⅲ. Describe what you expected to happen
Ⅳ. How to reproduce it (as minimally and precisely as possible)
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
The text was updated successfully, but these errors were encountered: