From 37ecc88487dd1543fe0404bd1d69bd3dd342af4d Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Tue, 15 Oct 2024 10:18:46 +0000 Subject: [PATCH 1/3] feat(compression): allow zstd-fast algorithm Signed-off-by: Abhinandan Purkait --- deploy/helm/charts/charts/crds/templates/zfsrestore.yaml | 2 +- deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml | 2 +- deploy/helm/charts/charts/crds/templates/zfsvolume.yaml | 2 +- deploy/yamls/zfsrestore-crd.yaml | 2 +- deploy/yamls/zfssnapshot-crd.yaml | 2 +- deploy/yamls/zfsvolume-crd.yaml | 2 +- deploy/zfs-operator.yaml | 6 +++--- pkg/apis/openebs.io/zfs/v1/zfsvolume.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml index b504b52dd..1f4bce051 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml @@ -91,7 +91,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml index fd9f7e5d1..aba2cc93b 100644 --- a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml @@ -60,7 +60,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml index 2836fb573..67c68fa5c 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml @@ -86,7 +86,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfsrestore-crd.yaml b/deploy/yamls/zfsrestore-crd.yaml index 70abb9f49..320947c16 100644 --- a/deploy/yamls/zfsrestore-crd.yaml +++ b/deploy/yamls/zfsrestore-crd.yaml @@ -89,7 +89,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfssnapshot-crd.yaml b/deploy/yamls/zfssnapshot-crd.yaml index 5ef63060f..27dbd32b9 100644 --- a/deploy/yamls/zfssnapshot-crd.yaml +++ b/deploy/yamls/zfssnapshot-crd.yaml @@ -58,7 +58,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfsvolume-crd.yaml b/deploy/yamls/zfsvolume-crd.yaml index 34e5383fc..22b4004f4 100644 --- a/deploy/yamls/zfsvolume-crd.yaml +++ b/deploy/yamls/zfsvolume-crd.yaml @@ -84,7 +84,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/zfs-operator.yaml b/deploy/zfs-operator.yaml index ccd4e4e20..b09bd289a 100644 --- a/deploy/zfs-operator.yaml +++ b/deploy/zfs-operator.yaml @@ -1377,7 +1377,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant @@ -1582,7 +1582,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant @@ -1989,7 +1989,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/pkg/apis/openebs.io/zfs/v1/zfsvolume.go b/pkg/apis/openebs.io/zfs/v1/zfsvolume.go index cb529a0a0..25a19ddff 100644 --- a/pkg/apis/openebs.io/zfs/v1/zfsvolume.go +++ b/pkg/apis/openebs.io/zfs/v1/zfsvolume.go @@ -106,7 +106,7 @@ type VolumeInfo struct { // the next day the compression was modified to "on", the data written prior to setting "on" will // not be compressed. // Default Value: off. - // +kubebuilder:validation:Pattern="^(on|off|lzjb|zstd|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$" + // +kubebuilder:validation:Pattern="^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$" Compression string `json:"compression,omitempty"` // Deduplication is the process for removing redundant data at the block level, From c9a0113b896a494bb5e0cbf34bb19ab0cb31d8c1 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 16 Oct 2024 06:21:21 +0000 Subject: [PATCH 2/3] test: add new entry for zstd-fast compression Signed-off-by: Abhinandan Purkait --- tests/utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/utils.go b/tests/utils.go index 659e72b46..696c8d2fb 100644 --- a/tests/utils.go +++ b/tests/utils.go @@ -639,7 +639,7 @@ func getStoragClassParams() []map[string]string { }, { "fstype": "zfs", - "compression": "zstd-6", + "compression": "zstd-fast", "dedup": "on", "thinprovision": "yes", }, @@ -677,5 +677,9 @@ func getStoragClassParams() []map[string]string { "compression": "zstd-6", "dedup": "on", }, + { + "fstype": "xfs", + "compression": "zstd-fast", + }, } } From 12145afbfab3a67fd228c8c9fccee573846ad907 Mon Sep 17 00:00:00 2001 From: Abhinandan Purkait Date: Wed, 16 Oct 2024 06:25:56 +0000 Subject: [PATCH 3/3] chore: simplify the regex Signed-off-by: Abhinandan Purkait --- deploy/helm/charts/charts/crds/templates/zfsrestore.yaml | 2 +- deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml | 2 +- deploy/helm/charts/charts/crds/templates/zfsvolume.yaml | 2 +- deploy/yamls/zfsrestore-crd.yaml | 2 +- deploy/yamls/zfssnapshot-crd.yaml | 2 +- deploy/yamls/zfsvolume-crd.yaml | 2 +- deploy/zfs-operator.yaml | 6 +++--- pkg/apis/openebs.io/zfs/v1/zfsvolume.go | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml index 1f4bce051..2ecc6830c 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsrestore.yaml @@ -91,7 +91,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml index aba2cc93b..8c0b11928 100644 --- a/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfssnapshot.yaml @@ -60,7 +60,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml index 67c68fa5c..41efc8a2b 100644 --- a/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml +++ b/deploy/helm/charts/charts/crds/templates/zfsvolume.yaml @@ -86,7 +86,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfsrestore-crd.yaml b/deploy/yamls/zfsrestore-crd.yaml index 320947c16..6066434cf 100644 --- a/deploy/yamls/zfsrestore-crd.yaml +++ b/deploy/yamls/zfsrestore-crd.yaml @@ -89,7 +89,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfssnapshot-crd.yaml b/deploy/yamls/zfssnapshot-crd.yaml index 27dbd32b9..63dbab107 100644 --- a/deploy/yamls/zfssnapshot-crd.yaml +++ b/deploy/yamls/zfssnapshot-crd.yaml @@ -58,7 +58,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/yamls/zfsvolume-crd.yaml b/deploy/yamls/zfsvolume-crd.yaml index 22b4004f4..9991b0786 100644 --- a/deploy/yamls/zfsvolume-crd.yaml +++ b/deploy/yamls/zfsvolume-crd.yaml @@ -84,7 +84,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/deploy/zfs-operator.yaml b/deploy/zfs-operator.yaml index b09bd289a..a73b252ee 100644 --- a/deploy/zfs-operator.yaml +++ b/deploy/zfs-operator.yaml @@ -1377,7 +1377,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant @@ -1582,7 +1582,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant @@ -1989,7 +1989,7 @@ spec: data. For instance, if the Volume was created with "off" and the next day the compression was modified to "on", the data written prior to setting "on" will not be compressed. Default Value: off.' - pattern: ^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$ + pattern: ^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$ type: string dedup: description: 'Deduplication is the process for removing redundant diff --git a/pkg/apis/openebs.io/zfs/v1/zfsvolume.go b/pkg/apis/openebs.io/zfs/v1/zfsvolume.go index 25a19ddff..3bd900846 100644 --- a/pkg/apis/openebs.io/zfs/v1/zfsvolume.go +++ b/pkg/apis/openebs.io/zfs/v1/zfsvolume.go @@ -106,7 +106,7 @@ type VolumeInfo struct { // the next day the compression was modified to "on", the data written prior to setting "on" will // not be compressed. // Default Value: off. - // +kubebuilder:validation:Pattern="^(on|off|lzjb|zstd|zstd-fast|zstd-[1-9]|zstd-1[0-9]|gzip|gzip-[1-9]|zle|lz4)$" + // +kubebuilder:validation:Pattern="^(on|off|lzjb|zstd(?:-fast|-[1-9]|-1[0-9])?|gzip(?:-[1-9])?|zle|lz4)$" Compression string `json:"compression,omitempty"` // Deduplication is the process for removing redundant data at the block level,