As a long time Drupal dev, I should probably know the answer to this question, but I'm stumped by the behavior I'm seeing.
Let's say I have a local and a remote site. On the remote site a module is uninstalled properly and the module code is removed from the file system (git tracks the deletion, etc).
Then to get my local installation up to date, I completely drop all tables in my database (it's completely empty) and I do a git pull, so the local module files are deleted. I then get the remote database and load it into my local.
In that situation there are no database remnants from my old local install and the file system is updated with the deleted modules. It should reflect the remote site completely.
However, when I load up the local site I get all the 'XXXX module is missing" and everything breaks. I run the registry rebuild via drush rr, and it fixes everything. But then, going forward into the future, I continue to see this broken registry each time I reload the site from the remote database (meaning I have to rr each time).
This strikes me as so odd...because where are those old registry records stored outside the database? Why, if I have a fully clean database, does it recognize old modules as missing?
And of course...how can I 'clean them up' permenantly?