Skip to content

Commit f6a3ac8

Browse files
committed
Moving VG creation to Node Stage Volume to fix duplicate bugs during
node reboot
1 parent c653070 commit f6a3ac8

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

cmd/gce-pd-csi-driver/main.go

-5
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,6 @@ func setupDataCache(ctx context.Context, nodeName string, nodeId string) error {
424424
return fmt.Errorf("Failed to Raid local SSDs, unable to setup Data Cache, got error %v", err)
425425
}
426426

427-
// Initializing data cache node (VG checks w/ raided lssd)
428-
if err := driver.InitializeDataCacheNode(nodeId); err != nil {
429-
return err
430-
}
431-
432427
klog.V(4).Infof("LSSD caching is setup for the Data Cache enabled node %s", nodeName)
433428
return nil
434429
}

pkg/gce-pd-csi-driver/cache.go

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func setupCaching(devicePath string, req *csi.NodeStageVolumeRequest, nodeId str
6969
if vgExists {
7070
// Clean up Volume Group before adding the PD
7171
reduceVolumeGroup(volumeGroupName, true)
72+
info, err := common.RunCommand("" /* pipedCmd */, nil /* pipedCmdArg */, "vgextend", []string{volumeGroupName, raidedLocalSsdPath}...)
73+
if err != nil {
74+
return "", fmt.Errorf("errored while extending volume group to add localssd %v, error: %v: %s", raidedLocalSsdPath, err, info)
75+
}
7276
} else {
7377
err := createVg(volumeGroupName, raidedLocalSsdPath)
7478
if err != nil {

0 commit comments

Comments
 (0)