Skip to content

Commit

Permalink
Reduced the time it takes to create and mount volumes on ECFS cluster…
Browse files Browse the repository at this point in the history
… with a large number of Data Containers
  • Loading branch information
jeanspector-google committed Apr 16, 2020
1 parent 08a54fa commit 209f811
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/ecfs/emanage-helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func (ems *emanageClient) GetClient() *emanageClient {
}

func (ems *emanageClient) GetDcByName(dcName string) (*emanage.DataContainer, error) {
glog.V(log.DEBUG).Infof("ecfs: GetDcByName - getting DCs from ECFS management")
glog.V(log.DEBUG).Infof("ecfs: GetDcByName %v - getting DCs from ECFS management", dcName)
dcs, err := ems.GetClient().DataContainers.GetAll(nil)
if err != nil {
return nil, errors.WrapPrefix(err, "Failed to list Data Containers", 0)
Expand Down
9 changes: 1 addition & 8 deletions src/ecfs/mounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,7 @@ func getNfsExportEcfs(volId volumeHandleType) (nfsExport string, err error) {
return
}

var emsClient emanageClient
dc, export, err := emsClient.GetDcDefaultExportByVolumeId(volId)
if err != nil {
err = errors.WrapPrefix(err, fmt.Sprintf("Failed to get DC/export for Volume Id %s", volId), 0)
return
}

return fmt.Sprintf("%v:%v/%v", nfsAddr, dc.Name, export.Name), nil
return fmt.Sprintf("%v:%v/%v", nfsAddr, string(volId), volumeExportName), nil
}

func getNfsExportEfaas(volId volumeHandleType) (nfsExport string, err error) {
Expand Down
11 changes: 0 additions & 11 deletions src/ecfs/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,6 @@ func createDc(emsClient *emanageClient, opt *volumeOptions) (*emanage.DataContai
}

func createExportForVolume(emsClient *emanageClient, volOptions *volumeOptions) (export emanage.Export, err error) {
found, export, err := exportExists(emsClient, volumeExportName, volOptions)
if err != nil {
err = errors.WrapPrefix(err, fmt.Sprintf("Failed to check if export %v exists on DC %v (%v)",
volumeExportName, volOptions.DataContainer.Id, volOptions.DataContainer.Name), 0)
return
}
if found {
glog.V(log.DEBUG).Infof("ecfs: Export %v for volume %v already exists - nothing to do", volumeExportName, volOptions.VolumeId)
return
}

exportOpt := &emanage.ExportCreateForVolumeOpts{
DcId: int(volOptions.DataContainer.Id),
Path: "/",
Expand Down

0 comments on commit 209f811

Please sign in to comment.