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

How radonDB implement Snapshot Isolation #7

Closed
louishust opened this issue May 9, 2018 · 3 comments
Closed

How radonDB implement Snapshot Isolation #7

louishust opened this issue May 9, 2018 · 3 comments

Comments

@louishust
Copy link

louishust commented May 9, 2018

Is there some design doc for implementation of Snapshot Isolation ?

Queue commit action?

// CommitLock used to acquire the commit.
func (mgr *TxnManager) CommitLock() {
	mgr.commitLock.Lock()
}
@BohuTANG
Copy link
Contributor

BohuTANG commented May 10, 2018

Hi @louishust,

radon has a commit lock to make snapshot isolation:
1, when 'xa commit' is in committing phase, it acquires a commit-lock at:

txn.mgr.CommitLock()

2, At the same time, if a read query executing, it will try to acquire the same lock at:

txn.mgr.CommitRLock()

So, he must wait the committing done.

This is the key to support snapshot isolation.
And, the backend MySQL must be in REPEATABLE-READ isolation level.

@louishust
Copy link
Author

louishust commented May 10, 2018

Thanks for your reply.

So the performance is like one thread?

If deploy two radondb in one cluster, how to maintain the lock?

@BohuTANG
Copy link
Contributor

BohuTANG commented May 10, 2018

1, As the case we talked above,, its YES.
2, The lock only works for one node, otherwise we cannot guaranteec the snapshot isolation.

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