Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin): speed up fetching cluster metadata
This PR improves `internal/admin/mrmanager.(*mrManager).ClusterMetadata` performance: - Fail-fast: If the given context is canceled, it returns a context error without acquiring the mutex. - Fast-path: If the cluster metadata does not need to update, it returns the existing thing without the exclusive lock. - Slow-path: It is similar to the previous implementation but shares the updated cluster metadata using a singleflight. This PR makes the `internal/admin/mrmanager.(*mrManager).ClusterMetadata` more concurrent and removes unnecessary RPCs. It also avoids RPC calls within exclusive mutex.
- Loading branch information