Skip to content

Commit 26c608f

Browse files
cemakdk8s-infra-cherrypick-robot
authored andcommitted
Fix partial cache tail latency by correcting the cache chunk size calculation
Undo temporary chunk size changes Fix temporary variable name change
1 parent ef68087 commit 26c608f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ func isCachingSetup(mainLvName string) (error, bool) {
576576
func fetchChunkSizeKiB(cacheSize string) (string, error) {
577577
var chunkSize float64
578578

579+
cacheSize = strings.TrimSuffix(cacheSize, "GiB")
579580
cacheSizeInt, err := strconv.ParseInt(cacheSize, 10, 64)
580581
if err != nil {
581582
return "0", err
@@ -691,10 +692,8 @@ func addRaidedLSSDToVg(vgName, lssdPath string) error {
691692

692693
func fetchPvSizeGiB() (string, error) {
693694
args := []string{
694-
"--select",
695-
"-o",
695+
"-o", "pv_name,pv_size",
696696
"--noheadings",
697-
"pv_size",
698697
"--units=b",
699698
}
700699
// RAIDed device is always registered with its /dev/md127 equivalent in VG so cannot check it directly based on the RAIDed LSSD path which could be /dev/md/csi-driver-data-cache

0 commit comments

Comments
 (0)