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

[BUG]create duplicate Notebooks when create a New Notebook #158

Open
kid0401 opened this issue May 20, 2022 · 1 comment
Open

[BUG]create duplicate Notebooks when create a New Notebook #158

kid0401 opened this issue May 20, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kid0401
Copy link

kid0401 commented May 20, 2022

When I created a New Notebook "Zoho", it was copied by 11 times ,like this:

图片

However, Normally, Byzer-notebook does not allow duplicate names.
I saw the table of database ,like this:
图片

And found some errors in the log ,like this:
图片

I hope these can help find the problem.

@ZhengshuaiPENG ZhengshuaiPENG added the bug Something isn't working label May 20, 2022
@ZhengshuaiPENG ZhengshuaiPENG added this to the Sprint-06/03 milestone May 20, 2022
@MichelZhan
Copy link
Collaborator

MichelZhan commented May 25, 2022

@ZhengshuaiPENG @chncaesar

Image

排查 access_log 发现实际发送了多次 创建notebook请求,而从前面的日志可以看到,此时数据库性能也有问题,简单查询都变成慢查询。原本在NotebookService.create 中创建notebook前会查询notebook_info中的记录,做重名判断,在此查询全部变慢的情况下此逻辑失效,多个创建notebook的事务同时执行,进而创建出很多同名notebook。
方案一,给notebook_info表加 unique索引,user+notebook_name+folder_id 作为唯一索引。但之前根目录folder_id默认是空值,这样的唯一索引是无效的。如果把默认folder_id改成其他值会涉及到元数据改动,前后端也要做调整,风险较大。
方案二,考虑到上面方案可能存在较大风险,现阶段可现在前端做并发控制。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants