Rebuild metadata