Skip to content
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

NAS-131014 / 24.10-RC.1 / Update dedup warnings (by undsoft) #10639

Merged
merged 3 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion src/app/helptext/storage/volumes/datasets/dataset-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ export const helptextDatasetForm = {
a one-way process. <b>Deduplicated data cannot be undeduplicated!</b>.'),
dataset_form_deduplication_warning: T('This feature is memory-intensive and <b>permanently affects how the data is stored</b>. It is recommended to be very familiar with the benefits and drawbacks of deduplication before activating this feature.'),

deduplicationWarning: T(`The default "Checksum" value for datasets with deduplication used to be SHA256.
deduplicationWarning: T('Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.'),
deduplicationChecksumWarning: T(`The default "Checksum" value for datasets with deduplication used to be SHA256.
Our testing has shown that SHA512 performs better for such datasets.
We've changed the checksum value from SHA256 to SHA512. You can change it back in "Advanced Options".`),

deduplicationChecksumInlineWarning: T('For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.'),

dataset_form_readonly_tooltip: T('Set to prevent the dataset from being modified.'),

dataset_form_exec_tooltip: T('Set whether processes can be executed from within this dataset.'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,6 @@
></ix-select>
}

@if (hasDedupWarning) {
<div
class="dedup-warning"
[innerHtml]="helptext.dataset_form_deduplication_warning | translate"
></div>
}

<ix-select
formControlName="casesensitivity"
[label]="'Case Sensitivity' | translate"
Expand All @@ -62,6 +55,10 @@
[label]="'Checksum' | translate"
></ix-select>

@if (hasChecksumWarning) {
<ix-warning [message]="helptext.deduplicationChecksumInlineWarning"></ix-warning>
}

<ix-select
formControlName="readonly"
[label]="'Read-only' | translate"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.dedup-warning,
.recordsize-warning {
color: var(--error);
font-size: 0.9rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { mockCall, mockWebSocket } from 'app/core/testing/utils/mock-websocket.u
import { AclMode } from 'app/enums/acl-type.enum';
import {
DatasetAclType,
DatasetCaseSensitivity, DatasetChecksum, DatasetRecordSize,
DatasetCaseSensitivity, DatasetRecordSize,
DatasetSnapdev,
DatasetSnapdir,
DatasetSync,
Expand Down Expand Up @@ -389,7 +389,7 @@ describe('OtherOptionsSectionComponent', () => {
});

describe('ZFS Deduplication', () => {
it('shows a warning when checksum is not SHA-512 and deduplication is enabled', async () => {
it('shows a warning when deduplication is enabled', async () => {
spectator.setInput({
parent: parentDataset,
});
Expand All @@ -403,8 +403,6 @@ describe('OtherOptionsSectionComponent', () => {
message: helptextDatasetForm.deduplicationWarning,
}),
);
expect(spectator.query('.dedup-warning')).toExist();
expect(spectator.component.form.value.checksum).toBe(DatasetChecksum.Sha512);
});

it('does not show deduplication field on Enterprise systems that do not have a dedup license', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
@Output() formValidityChange = new EventEmitter<boolean>();

hasDeduplication = false;
hasDedupWarning = false;
hasRecordsizeWarning = false;
wasDedupChecksumWarningShown = false;
minimumRecommendedRecordsize = '128K' as DatasetRecordSize;
Expand Down Expand Up @@ -150,6 +149,11 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
private datasetFormService: DatasetFormService,
) {}

get hasChecksumWarning(): boolean {
return this.form.value.checksum === DatasetChecksum.Sha256
&& this.form.value.deduplication !== DeduplicationSetting.Off;
}

ngOnChanges(changes: IxSimpleChanges<this>): void {
if (changes.datasetPreset?.currentValue) {
this.setUpDatasetPresetSelect();
Expand All @@ -159,10 +163,13 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
return;
}

this.setUpDedupWarnings();
this.setUpRecordsizeWarning();
this.setSelectOptions();

this.setFormValues();

this.checkDedupChecksum();
this.setUpDedupWarning();
this.setUpAclTypeWarning();
this.updateAclMode();
this.disableCaseSensitivityOnEdit();
Expand Down Expand Up @@ -367,26 +374,50 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
}
}

private setUpDedupWarnings(): void {
private setUpDedupWarning(): void {
this.form.controls.deduplication.valueChanges.pipe(untilDestroyed(this)).subscribe((dedup) => {
if (!dedup || [DeduplicationSetting.Off, inherit].includes(dedup)) {
this.hasDedupWarning = false;
this.cdr.markForCheck();
return;
}

this.hasDedupWarning = true;
this.cdr.markForCheck();
this.dialogService.confirm({
title: this.translate.instant('Warning'),
message: this.translate.instant(helptextDatasetForm.deduplicationWarning),
hideCheckbox: true,
})
.pipe(untilDestroyed(this))
.subscribe((confirmed) => {
if (confirmed) {
this.checkDedupChecksum();
} else {
this.form.patchValue({
deduplication: inherit,
});
}
});
});
}

const checksum = this.form.controls.checksum.value;
if (this.wasDedupChecksumWarningShown || !checksum || checksum === DatasetChecksum.Sha512) {
return;
}
private checkDedupChecksum(): void {
const dedup = this.form.controls.deduplication.value;
if (!dedup || [DeduplicationSetting.Off, inherit].includes(dedup)) {
return;
}

this.showDedupChecksumWarning();
this.form.patchValue({
checksum: DatasetChecksum.Sha512,
});
const checksum = this.form.controls.checksum.value;
if (
this.wasDedupChecksumWarningShown
|| !checksum
|| checksum === DatasetChecksum.Sha512
|| checksum !== DatasetChecksum.Sha256
) {
return;
}

this.showDedupChecksumWarning();
this.form.patchValue({
checksum: DatasetChecksum.Sha512,
});
}

Expand All @@ -407,7 +438,7 @@ export class OtherOptionsSectionComponent implements OnInit, OnChanges {
hideCancel: true,
title: this.translate.instant('Default Checksum Warning'),
hideCheckbox: true,
message: this.translate.instant(helptextDatasetForm.deduplicationWarning),
message: this.translate.instant(helptextDatasetForm.deduplicationChecksumWarning),
buttonText: this.translate.instant('OK'),
});
}
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ast.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1693,6 +1694,7 @@
"Flash Identify Light": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force Clear": "",
"Force Delete": "",
"Force Delete?": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -1158,6 +1158,7 @@
"Decipher Only": "",
"Dedup": "",
"Dedup VDEVs": "",
"Deduplication is experimental in 24.10 and not fully supported. When enabled, data is permanently stored with this memory-intensive method and cannot be undone. Take extreme caution and ensure you have adequate data backups before enabling this feature.": "",
"Default": "",
"Default ACL Options": "",
"Default Checksum Warning": "",
Expand Down Expand Up @@ -1873,6 +1874,7 @@
"Follow symlinks and copy the items to which they link.": "",
"Following container images are available to update:\n": "",
"For example if you set this value to 5, system will renew certificates that expire in 5 days or less.": "",
"For performance reasons SHA512 is recommended over SHA256 for datasets with deduplication enabled.": "",
"Force": "",
"Force Clear": "",
"Force Delete": "",
Expand Down
Loading
Loading