-
Notifications
You must be signed in to change notification settings - Fork 262
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
fix drop database failure #16000
fix drop database failure #16000
Conversation
@daviszhen Thanks for your contributions! Pull Request Review:Title:The title of the pull request is clear and concise, indicating that the purpose of the PR is to fix a failure related to dropping a database. Body:The body of the pull request provides essential information about the issue being addressed and references the related GitHub issue. It explains the root cause of the problem and the proposed solution, which involves storing deleted databases in a map to prevent errors when iterating through the database cache. Changes:
Feedback and Suggestions:
By addressing the above points, you can enhance the quality, performance, and security of the codebase while ensuring that the fix for the database drop failure is robust and reliable. |
What type of PR is this?
Which issue(s) this PR fixes:
issue #https://github.com/matrixorigin/MO-Cloud/issues/3206
What this PR does / why we need it:
问题原因:
在drop database 会从mo_table_partitions删除索引信息。过程中会加锁。
加锁过程中,会用tableId 取relation。
取relation时,会遍历CatalogCache中的数据库。但是同一个事务中的数据库已经被删除了。
导致engine.Database取Database对象时,报错。
修改方案:
事务中删除drop database时,会先存入deletedDatabaseMap。
在遍历catalogCache中的数据库时,将已经加入deletedDatabaseMap的数据库名称排除掉。避免报错。
ci regression: https://github.com/matrixorigin/ci-test/actions/runs/9032264260