From 75222752d22abfd423f8c650f5ebf1e5c3f96ff7 Mon Sep 17 00:00:00 2001 From: Derek Su Date: Thu, 17 Nov 2022 12:24:24 +0800 Subject: [PATCH] snapshot check: add settings Longhorn 4210 Longhorn 3198 Signed-off-by: Derek Su --- chart/questions.yaml | 23 +++++++++++++++++++++++ chart/templates/default-setting.yaml | 6 ++++-- chart/values.yaml | 3 +++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/chart/questions.yaml b/chart/questions.yaml index 413c3a1..bddca0b 100644 --- a/chart/questions.yaml +++ b/chart/questions.yaml @@ -563,6 +563,29 @@ WARNING: group: "Longhorn Default Settings" type: int default: "8" +- variable: defaultSettings.snapshotDataIntegrity + label: Snapshot Data Integrity + description: "This setting allows users to enable or disable snapshot hashing and data integrity checking. + Available options are + - **disabled**: Disable snapshot disk file hashing and data integrity checking. + - **enabled**: Enables periodic snapshot disk file hashing and data integrity checking. To detect the filesystem-unaware corruption caused by bit rot or other issues in snapshot disk files, Longhorn system periodically hashes files and finds corrupted ones. Hence, the system performance will be impacted during the periodical checking. + - **fast-check**: Enable snapshot disk file hashing and fast data integrity checking. Longhorn system only hashes snapshot disk files if their are not hashed or the modification time are changed. In this mode, filesystem-unaware corruption cannot be detected, but the impact on system performance can be minimized." + group: "Longhorn Default Settings" + type: string + default: "disabled" +- variable: defaultSettings.snapshotDataIntegrityImmediateCheckAfterSnapshotCreation + label: Immediate Snapshot Data Integrity Check After Creating a Snapshot + description: "Hashing snapshot disk files impacts the performance of the system. The immediate snapshot hashing and checking can be disabled to minimize the impact after creating a snapshot." + group: "Longhorn Default Settings" + type: boolean + default: "false" +- variable: defaultSettings.snapshotDataIntegrityCronjob + label: Snapshot Data Integrity Check CronJob + description: "Unix-cron string format. The setting specifies when Longhorn checks the data integrity of snapshot disk files. + Warning: Hashing snapshot disk files impacts the performance of the system. It is recommended to run data integrity checks during off-peak times and to reduce the frequency of checks." + group: "Longhorn Default Settings" + type: string + default: "0 0 */7 * *" - variable: persistence.defaultClass default: "true" description: "Set as default StorageClass for Longhorn" diff --git a/chart/templates/default-setting.yaml b/chart/templates/default-setting.yaml index 46d4469..f9adc03 100644 --- a/chart/templates/default-setting.yaml +++ b/chart/templates/default-setting.yaml @@ -67,5 +67,7 @@ data: {{ if not (kindIs "invalid" .Values.defaultSettings.orphanAutoDeletion) }}orphan-auto-deletion: {{ .Values.defaultSettings.orphanAutoDeletion }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.storageNetwork) }}storage-network: {{ .Values.defaultSettings.storageNetwork }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.deletingConfirmationFlag) }}deleting-confirmation-flag: {{ .Values.defaultSettings.deletingConfirmationFlag }}{{ end }} - {{ if not (kindIs "invalid" .Values.defaultSettings.engineReplicaTimeout) }}deleting-confirmation-flag: {{ .Values.defaultSettings.engineReplicaTimeout }}{{ end }} - + {{ if not (kindIs "invalid" .Values.defaultSettings.engineReplicaTimeout) }}engine-replica-timeout: {{ .Values.defaultSettings.engineReplicaTimeout }}{{ end }} + {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrity) }}snapshot-data-integrity: {{ .Values.defaultSettings.snapshotDataIntegrity }}{{ end }} + {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrityImmediateCheckAfterSnapshotCreation) }}snapshot-data-integrity-immediate-check-after-snapshot-creation: {{ .Values.defaultSettings.snapshotDataIntegrityImmediateCheckAfterSnapshotCreation }}{{ end }} + {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrityCronjob) }}snapshot-data-integrity-cronjob: {{ .Values.defaultSettings.snapshotDataIntegrityCronjob }}{{ end }} diff --git a/chart/values.yaml b/chart/values.yaml index 730ca11..e4fd034 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -141,6 +141,9 @@ defaultSettings: storageNetwork: ~ deletingConfirmationFlag: ~ engineReplicaTimeout: ~ + snapshotDataIntegrity: ~ + snapshotDataIntegrityImmediateCheckAfterSnapshotCreation: ~ + snapshotDataIntegrityCronjob: ~ privateRegistry: createSecret: ~ registryUrl: ~