merged with upstream sync_exist