Merge change 6403 into donut

* changes:
  Fix the metadata-available test during restore