Always remove dropped tables from remote data folder cache - #427
Open
CGodiksen wants to merge 2 commits into
Open
Always remove dropped tables from remote data folder cache#427CGodiksen wants to merge 2 commits into
CGodiksen wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are localized, align with the stated cluster cache-invalidation bug, and reuse existing location computation to remove the correct cache entry.
Pull request overview
Fixes stale DeltaTable cache entries in clustered deployments so that dropping a table reliably invalidates cached remote-table handles on peer nodes, preventing cache-related errors when recreating a table with the same name.
Changes:
- Move Delta table cache invalidation out of
delete_table_files()and make it an explicit step inDataFolder::drop_table(). - Add
DataFolder::remove_delta_table_from_cache()to centralize cache invalidation logic. - Ensure
Context::drop_table()also clears the remote data folder cache (when present) to handle peer-node cache invalidation in clusters.
File summaries
| File | Description |
|---|---|
| crates/modelardb_storage/src/data_folder/mod.rs | Refactors drop path to explicitly remove the dropped table’s DeltaTable from the cache via a new helper method. |
| crates/modelardb_server/src/context.rs | Clears the remote data folder’s cached DeltaTable on table drop to prevent stale cache usage on peer nodes in clusters. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
skejserjensen
approved these changes
Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes a bug that causes errors if a table was dropped in a cluster and then a table with the same name was created. When we drop tables in clusters, the node receiving the
DROP tablestatement is responsible for dropping the table from the remote data folder and its local data folder and each peer node is only responsible for dropping the table from their own local data folder.However, since we cache the tables in both the local data folder and the remote data folder, and the cache is only cleared when the table is dropped from the
DataFolder, the peer nodes never removed the cached version from their remote data folder. This means a cache error was caused on the peer nodes if a table with the same name was created again.This PR moves cache removal up, adds a separate method for it in
DataFolder, and always tries to remove the table from the remote data folder cache when it is dropped. This means we technically "remove" the table from the remote data folder cache twice on the node receiving the statement, but the operation is cheap.