Fixes #5598: Properly update metadata cache in update_metadata()
Merge pull request #5619 from mrclay/5598

Fixes #5598: Properly update metadata cache in update_metadata()