Skip to content

fix txn deadlock during drop account - #20579

Merged
mergify[bot] merged 1 commit into
matrixorigin:2.0-devfrom
daviszhen:1205-use-select-for-update-2.0-dev
Dec 5, 2024
Merged

mergify[bot] merged 1 commit into
matrixorigin:2.0-devfrom
daviszhen:1205-use-select-for-update-2.0-dev

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表。

This branch was previously deployed

1 inactive deployment
ci — 848b60ad 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.

4 participants