fix(sql): fix internal error when concurrent threads try to drop a non-wal table#6462
fix(sql): fix internal error when concurrent threads try to drop a non-wal table#6462bluestreak01 merged 1 commit intomasterfrom
Conversation
…same non-wal table
WalkthroughThe Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2025-11-07T00:59:31.522ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (33)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Happy Thursday, dear @coderabbitai, would you be so kind as to review this humble PR? |
|
@jerrinot, happy Thursday to you as well! I'd be delighted to review this PR. Let me take a look at the changes to fix the concurrent drop table race condition. 🐰 ✅ Actions performedReview triggered.
|
[PR Coverage check]😍 pass : 2 / 3 (66.67%) file detail
|
When multiple clients try to drop the same non-WAL table, then there is a small chance of getting an internal error.
This issue affects only legacy (non-WAL) tables. This change fixes the problem.
Details for reviewers:
It was caught by
testConcurrentCreateDropRemove(), it's reproducible locally, it helps to decreasetableCountparameter in the test. This is the stacktrace:Root cause: CairoEngine unlocks the table too early. So another thread can acquire a lock (for now a non-existing table), tries to delete the directory, but the directory no longer exists -> failure with errno=2.