Skip to content

feat: add row-level locking to LoadUserByID #187

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SmilingPixel
Copy link
Member

resolve #150

  • 影响业务逻辑:查询用户,不存在则创建
  • 修改:事务中的查询操作,加上写锁(SELECT FOR UPDATE)。查询字段id走了索引,锁是行级别的,预估对性能影响有限。
  • 自测:本地测试,可正常读取用户信息

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

Successfully merging this pull request may close these issues.

[BUG] GetUser 并发问题
1 participant