The following steps lead to a situation where drush cc all would fail.
- Build a site, with fields and stuff. Especially one or some fields for the user entity.
- Install an alternative cache plugin, e.g. mongodb.
- Change the site configuration. E.g. remove one of the fields on user entity.
- Disable the alternative cache plugin, switch back to database cache.
Now the database cache contains really old data (or this is how I imagine it), still referencing fields that have long been deleted.
On drush cc all, drush first wants to bootstrap Drupal. Doing this, it also tries to load a user account for login. This lets it use cached data for user fields.
I get a crash with mysql exception from field_sql_storage_field_storage_load(), because it tries to load non-existing fields.
I suppose this is just one example for a site being broked due to really old cache data, after switching the cache plugin.
How can one recover from this situation?