Skip to content
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

如果用GTS的那种方法的话,就没有必要用XA了 #2

Open
manorsuperman opened this issue Sep 13, 2018 · 3 comments
Open

如果用GTS的那种方法的话,就没有必要用XA了 #2

manorsuperman opened this issue Sep 13, 2018 · 3 comments

Comments

@manorsuperman
Copy link

XA 本身是可以保证数据的一致性的, 直接用普通的begin commit/rollback 就可以了。因为前置镜像和后置镜像以及 txc_lock可以在很大程度上保证资源不会被修改(也有可能通过命令行或者其他的发送绕过txc_lock检查的,这时候就可能数据不一致)。我觉得不需要数据库的XA。

@manorsuperman
Copy link
Author

@wxbty 还有不知道是否支持 where pk >= 1 and pk <=10,类似这种的有范围的更新语句.

@wxbty
Copy link
Owner

wxbty commented Sep 13, 2018

确实不需要xa 来支持分支事务。meepo现在的xa事务,从start到commit,和普通到begin commit在效率上并没有区别。使用xa是因为基于bytejta的代码,边测试边开发边提交,继续使用xa事务可以平滑过度,减少bug。后续这块会改,但优先级不高

@wxbty
Copy link
Owner

wxbty commented Sep 13, 2018

where pk >= 1 and pk <=10 支持这种语句。
生成回滚sql伪代码
delete from table where pk >= 1 and pk <=10
->select * from table where pk >= 1 and pk <=10
foreach()
{
genBeforeImage;
genAfterImage;
insert(image);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants