use do-while to sync_with_primary