-
Notifications
You must be signed in to change notification settings - Fork 43
Button to write restored snapshot files sparsely #61
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
Conversation
This commit adds a new radial button (required value) to the snapshot restore window allowing users to enable the sparse restore option. When enabled, the restored snapshot's files are written sparsely, minimizing disk allocations for the written content. This option is disabled by default.
| {RequiredBoolean(this, "Write files atomically", "writeFilesAtomically")} | ||
| </Row> | ||
| <Row> | ||
| {RequiredBoolean(this, "Write files sparsely", "writeFilesSparsely")} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "sparse files" is more obvious here, so "Write sparse files". Also the second argument should be the name of the JSON field, so "sparse".
See #57 (comment) for testing instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks for the feedback and test instructions. Iterating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to match JSON tag in restore.FilesystemOutput:
// Sparse when set to true causes the restored files to be sparse.
Sparse bool `json:"sparse"`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, so what does this line do:
req.fsOutput = {
...
writeFilesAtomically: this.state.writeFilesAtomically
+ sparse: this.state.writeFilesSparsely,
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, got it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In hindsight, this is a minor stylistic point, but I agree it's better to rename this variable WriteSparseFiles everywhere (--sparse -> --write-sparse-files etc.) I fear of breaking backwards compatibility, so will leave it as is in restore.FilesystemOutput for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a new feature so not really breaking, i think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented this here: kopia/kopia#2095. I'll follow up with changes to the UI once the above is merged.
* Button to write restored snapshot files sparsely kopia/htmlui#61 by @adowair * Refine appearance of "Create New Repository" form kopia/htmlui#62 by @gitname * Fix a couple typos, adjust some wording, and cleanup some formatting kopia/htmlui#63 by @L1ghtmann * Display task status durations using larger time units kopia/htmlui#64 by @gitname * Display repository description on every page kopia/htmlui#65
This commit renames the sparse restore flag (`kopia snapshot restore` and `kopia restore`) to conform more with the naming precedents in the Kopia code. This is a breaking change. The original motivation can be found here: kopia/htmlui#61 (comment)
This commit renames the sparse restore flag (`kopia snapshot restore` and `kopia restore`) to conform more with the naming precedents in the Kopia code. This is a breaking change. The original motivation can be found here: kopia/htmlui#61 (comment)
This commit adds a new radial button (required value) to the snapshot
restore window allowing users to enable the sparse restore option.
When enabled, the restored snapshot's files are written sparsely,
minimizing disk allocations for the written content. This option is
disabled by default.