-
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
when doing global rollback ,may cause an endless loop #6561
Comments
If it is confirmed that it is not specially designed like this, I can mention pr to fix it. |
When data needs to be restored to a state before deletion, and its unique index is being used by other rows, do you think this data is unrecoverable? Should such data be restored in an incomplete state? |
It should be unrecoverable, at least from the point of view of seata. I think it can be treated as a dirty write operation, so that seata-server can keep the retry at a fixed frequency. |
I agree with this approach. In fact, it is unrecoverable. |
Then I'll mention a pr to fix it. Now this situation is an endless cycle because outside "for(;;)", and it should be possible to fix it. |
@funky-eyes Please assign to me, I will fix it. |
ok |
Ⅰ. Issue Description
if there is a table like
CREATE TABLE
t_test(
uridint NOT NULL,
namevarchar(64) DEFAULT NULL, PRIMARY KEY (
urid), UNIQUE KEY
t_test_name(
name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
name is a uniquekey. and There is a piece of data in the table. (1,1)
1、global Transaction execute the sql "delete from t_test where id = 1", and this transaction need rollback
2、when rollbacking,other thread execute a sql like "insert into t_test values (2,1)"
3、that will cause the rollback thread endless loop.
Ⅱ. Describe what happened
that's because the range of the code "catch (SQLIntegrityConstraintViolationException e)" is too wide in AbstractUndoLogManager#undo
and rollback of business will be catched by this.
that should just catch "insertUndoLogWithGlobalFinished"
java -version
):uname -a
): centos7The text was updated successfully, but these errors were encountered: