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

DDC-1653: command line cache clear commands clear everything from caches including non Doctrine related caches #2296

Closed
doctrinebot opened this issue Feb 15, 2012 · 3 comments
Assignees
Milestone

Comments

@doctrinebot
Copy link

Jira issue originally created by user redemption:

When I run doctrine orm:clear-cache:metadata I noticed that it clears everything within the cache, even items which have nothing to do with Doctrine at all.

In looking into the various driver implementations it seems that the AbstractCache->deleteAll() depends on getIds of each cache driver, yet the getIds of XcacheCache and MemcacheCache drivers seem to just get every single item within the cache.

This has several implications:

clearing metadata cache actually clears query cache and any other Doctrine cache using the same cache driver

clearing Doctrine cache of one project actually clears caches of every project using the same cache container

clearing Doctrine cache clears every object cached within that container, leading to increased risk of cache stampeding

In looking at the stored cache data it seems possible to fix #2 by using the Namespace of that project when executing a cache clear. it also seems possible to use the cache driver's deleteByRegex() to solve #1 by deleting only items listed as metadata cache vs query cache. Fixing #1 and #2 automatically fixes concern #3

Or, as an alternative, I could suggest that deleteAll() in MetaDataCommand should be replaced by:

$cacheIds = $cacheDriver->deleteBySuffix('METADATA');
@doctrinebot
Copy link
Author

Comment created by redemption:

I think this issue might be resolved in 2.2 since the cache layer seems to have been rewritten.

@doctrinebot
Copy link
Author

Comment created by @guilhermeblanco:

To address this issue we require the rewrite that was done in 2.2.
Closing as fixed.

@doctrinebot
Copy link
Author

Issue was closed with resolution "Fixed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants