fix: prevent metadata table from being dropped#843
Conversation
…iation When createCollection is called for the _metadata table and the table already exists, the orphan reconciliation code would drop and recreate it, destroying all collection metadata. This breaks upgrades where Database::create() is called on an existing database. The fix adds _metadata to the safe list alongside shared-tables checks, ensuring the metadata table is never treated as an orphan.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Greptile SummaryThis PR fixes a critical data-loss bug in Key changes:
Root cause: The original condition What was not changed: The orphan reconciliation logic for non-metadata collections in non-shared-tables mode is completely unaffected; the shared-tables path for non-metadata tables is also unchanged. Confidence Score: 5/5
Important Files Changed
|
When createCollection is called for the _metadata table and the table already exists, the orphan reconciliation code would drop and recreate it, destroying all collection metadata. This breaks upgrades where Database::create() is called on an existing database.
The fix adds _metadata to the safe list alongside shared-tables checks, ensuring the metadata table is never treated as an orphan.
Summary by CodeRabbit