mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +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:
@ -31,6 +31,10 @@ type DefaultNodeServer struct {
|
||||
Driver *CSIDriver
|
||||
Type string
|
||||
Mounter mount.Interface
|
||||
// NodeLabels stores the node labels
|
||||
NodeLabels map[string]string
|
||||
// CLIReadAffinityOptions contains map options passed through command line to enable read affinity.
|
||||
CLIReadAffinityOptions string
|
||||
}
|
||||
|
||||
// NodeGetInfo returns node ID.
|
||||
|
@ -55,13 +55,18 @@ func NewVolumeCapabilityAccessMode(mode csi.VolumeCapability_AccessMode_Mode) *c
|
||||
}
|
||||
|
||||
// NewDefaultNodeServer initializes default node server.
|
||||
func NewDefaultNodeServer(d *CSIDriver, t string, topology map[string]string) *DefaultNodeServer {
|
||||
func NewDefaultNodeServer(
|
||||
d *CSIDriver, t, cliReadAffinityMapOptions string,
|
||||
topology, nodeLabels map[string]string,
|
||||
) *DefaultNodeServer {
|
||||
d.topology = topology
|
||||
|
||||
return &DefaultNodeServer{
|
||||
Driver: d,
|
||||
Type: t,
|
||||
Mounter: mount.NewWithoutSystemd(""),
|
||||
Driver: d,
|
||||
Type: t,
|
||||
Mounter: mount.NewWithoutSystemd(""),
|
||||
NodeLabels: nodeLabels,
|
||||
CLIReadAffinityOptions: cliReadAffinityMapOptions,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user