Skip to content

fix txn deadlock during drop account - #20580

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
daviszhen:1205-use-select-for-update
Dec 5, 2024
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
daviszhen:1205-use-select-for-update

Conversation

@daviszhen

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #https://github.com/matrixorigin/MO-Cloud/issues/4563

What this PR does / why we need it:

原因:并发的drop account 导致的死锁。

修改:在查询mo_account表(sys租户)时,用select ... for update。这个避免多个drop account 并发执行的问题。

潜在的问题:锁住mo_account表,会阻塞创建/更新租户、创建/alter/drop/show发布订阅。这些业务也会查mo_account表。

@mergify mergify Bot added the kind/bug Something isn't working label Dec 5, 2024
@mergify
mergify Bot merged commit 6df880a into matrixorigin:main Dec 5, 2024
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
原因:并发的drop account 导致的死锁。

修改:在查询mo_account表(sys租户)时,用`select ... for update`。这个避免多个drop account 并发执行的问题。

潜在的问题:锁住mo_account表,会阻塞创建/更新租户、创建/alter/drop/show发布订阅。这些业务也会查mo_account表。

Approved by: @qingxinhome

This branch was previously deployed

1 inactive deployment
ci — a52be9ab Deployed Dec 5, 2024 by mergify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants