Fixes #6383 Invalidate caches before running the upgrade.
Merge remote-tracking branch 'origin/master'