Skip to content

[Fix] : replace point locks with table lock in some cases (#15578) - #15763

Merged
mergify[bot] merged 3 commits into
matrixorigin:mainfrom
jensenojs:fix_moc3006
Apr 30, 2024
Merged

mergify[bot] merged 3 commits into
matrixorigin:mainfrom
jensenojs:fix_moc3006

Conversation

@jensenojs

Copy link
Copy Markdown
Contributor

Previous pr's used the wrong stats, now it's standardized to do the judgement in the last step of building the logic plan.

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/3006

What this PR does / why we need it:

sql like insert into A select * from B, will try to lock the value in B. When the number of these locks is too much, it will lead to bugs reflected in the issue. In the context of range locks being temporarily unavailable, use table lock to replace point lock

@matrix-meow matrix-meow added the size/S Denotes a PR that changes [10,99] lines label Apr 28, 2024
@mergify mergify Bot added the kind/bug Something isn't working label Apr 28, 2024
Comment thread pkg/sql/plan/build_util.go Resolved
Comment thread pkg/sql/plan/query_builder.go Resolved
@jensenojs

jensenojs commented Apr 28, 2024 •

Copy link
Copy Markdown
Contributor Author

moc3039

https://github.com/matrixorigin/MO-Cloud/issues/3039
这个issue中有诸多反映同一问题的SQL, 其测试结果如下所示
Pasted Graphic 5

select for update

main

Pasted Graphic 6

this pr

Pasted Graphic 7

…in#15578)

sql like `insert into A select * from B`, will try to lock the value in `B`. When the number of these locks is too much, it will lead to bugs reflected in the issue. In the context of range locks being temporarily unavailable, use table lock to replace point lock

Previous pr's used the wrong stats, now it's standardized to do the judgement in the last step of building the logic plan.
@jensenojs

Copy link
Copy Markdown
Contributor Author

@mergify
mergify Bot merged commit 310c959 into matrixorigin:main Apr 30, 2024
@jensenojs
jensenojs deleted the fix_moc3006 branch April 30, 2024 02:47
fengttt pushed a commit to fengttt/matrixone that referenced this pull request May 7, 2026
…in#15578) (matrixorigin#15763)

sql like `insert into A select * from B`, will try to lock the value in `B`. When the number of these locks is too much, it will lead to bugs reflected in the issue. In the context of range locks being temporarily unavailable, use table lock to replace point lock

Approved by: @zhangxu19830126, @reusee, @ouyuanning, @daviszhen
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.

6 participants