mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cephfs: add read affinity mount option
This commit makes use of crush location labels from node labels to supply `crush_location` and `read_from_replica=localize` options during mount. Using these options, cephfs will be able to redirect reads to the closest OSD, improving performance. Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -48,7 +48,8 @@ func ConstructReadAffinityMapOption(crushLocationMap map[string]string) string {
|
||||
// If not, it falls back to returning the `cliReadAffinityMapOptions` from the command line.
|
||||
// If neither of these options is available, it returns an empty string.
|
||||
func GetReadAffinityMapOptions(
|
||||
clusterID, cliReadAffinityMapOptions string, nodeLabels map[string]string,
|
||||
csiConfigFile, clusterID, cliReadAffinityMapOptions string,
|
||||
nodeLabels map[string]string,
|
||||
) (string, error) {
|
||||
var (
|
||||
err error
|
||||
@ -56,7 +57,7 @@ func GetReadAffinityMapOptions(
|
||||
configCrushLocationLabels string
|
||||
)
|
||||
|
||||
configReadAffinityEnabled, configCrushLocationLabels, err = GetCrushLocationLabels(CsiConfigFile, clusterID)
|
||||
configReadAffinityEnabled, configCrushLocationLabels, err = GetCrushLocationLabels(csiConfigFile, clusterID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Reference in New Issue
Block a user