Skip to content

Conversation

@adowair
Copy link
Contributor

@adowair adowair commented Jun 16, 2022

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.

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")}
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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"`

Copy link
Contributor Author

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,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, got it

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

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.

@jkowalski jkowalski merged commit e249149 into kopia:main Jun 20, 2022
jkowalski added a commit to jkowalski/kopia that referenced this pull request Jun 24, 2022
* 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
adowair added a commit to kastenhq/kopia that referenced this pull request Jun 28, 2022
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)
@adowair adowair deleted the sparse-restore branch June 29, 2022 07:36
jkowalski pushed a commit to kopia/kopia that referenced this pull request Jul 2, 2022
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants