Skip to content

Return DataLoss error status for any Data Cache related code in NodeStageVolume & NodeUnstageVolume. #1948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/gce-pd-csi-driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage
}
devicePath, err = setupCaching(devFsPath, req, nodeId)
if err != nil {
return nil, status.Error(codes.Internal, fmt.Sprintf("Error setting up cache: %v", err.Error()))
return nil, status.Error(codes.DataLoss, fmt.Sprintf("Error setting up cache: %v", err.Error()))
}
}

Expand Down Expand Up @@ -509,7 +509,7 @@ func (ns *GCENodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUns
nodeId := ns.MetadataService.GetName()
err := cleanupCache(volumeID, nodeId)
if err != nil {
klog.Errorf("Failed to cleanup cache for volume %s: %v", volumeID, err)
return nil, status.Errorf(codes.DataLoss, "Failed to cleanup cache for volume %s: %v", volumeID, err)
}
}
klog.V(4).Infof("NodeUnstageVolume succeeded on %v from %s", volumeID, stagingTargetPath)
Expand Down