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

Dead lock may occur on MEMORY_STRICTLY mode when get connection on concurrency environment #1186

Closed
tuohai666 opened this issue Aug 26, 2018 · 1 comment
Assignees

Comments

@tuohai666
Copy link
Member

In MEMORY_STRICTLY mode to avoid dead lock in connection pool, we must meet the condition:
ds.maximumPoolSize >= acceptor.size * ds.table_count.

If we get all connections needed synchronized between queries, we just need to meet the condition:
ds.maximumPoolSize >= ds.table_count.

According to the performance test, there's little degrade of the QPS.

@terrymanu
Copy link
Member

terrymanu commented Aug 26, 2018

The problem is SQL request may route to multiple sharding tables on same database, and each SQL request may get part of database connection, and waiting to release by others.

So just sync get connection as a atomic operate, let one SQL request can hold whole database connection at once.

fixed at 3.0.0.M3.

@terrymanu terrymanu changed the title Get connections synchronized in MEMORY_STRICTLY mode Get dead lock when in MEMORY_STRICTLY mode for get connection on concurrency environment Aug 26, 2018
@terrymanu terrymanu changed the title Get dead lock when in MEMORY_STRICTLY mode for get connection on concurrency environment Dead lock may occur on MEMORY_STRICTLY mode when get connection on concurrency environment Aug 26, 2018
@terrymanu terrymanu self-assigned this Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants