Merge pull request #4803 from tiennou/fix/4802 index: release the snapshot instead of freeing the index