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

release-20.2: cli: fix default value in help text of max-disk-temp-storage flag #55055

Merged
merged 1 commit into from
May 6, 2021

Conversation

DuskEagle
Copy link
Member

Backport 1/1 commits from #54853.

/cc @cockroachdb/release


Previously, in the output of cockroach start --help, the
--max-disk-temp-storage flag section reported that the default value
for the flag was "0 B".

$ cockroach start --help
...
      --max-disk-temp-storage bytes
...
          (default 0 B)

This is inaccurate, as the actual default value is dependent on whether
the store is a disk store or an in-memory store.

To fix this, this patch changes the BytesValue.String() method when the
underlying value is nil. Previously, it would return "0 B", which caused
our flags library to think the value was a non-zero value. By changing
the method to return "<nil>", our flags library recognizes the value as
a zero value, and does not print an incorrect default value for the flag
in our help text.

Release note (cli change): The --help text for --max-disk-temp-storage
now properly reports the default value.

Previously, in the output of `cockroach start --help`, the
`--max-disk-temp-storage` flag section reported that the default value
for the flag was "0 B".

```
$ cockroach start --help
...
      --max-disk-temp-storage bytes
...
          (default 0 B)
```

This is inaccurate, as the actual default value is dependent on whether
the store is a disk store or an in-memory store.

To fix this, this patch changes the BytesValue.String() method when the
underlying value is nil. Previously, it would return "0 B", which caused
our flags library to think the value was a non-zero value. By changing
the method to return "<nil>", our flags library recognizes the value as
a zero value, and does not print an incorrect default value for the flag
in our help text.

Release note (cli change): The --help text for --max-disk-temp-storage
now properly reports the default value.
@DuskEagle DuskEagle requested a review from knz September 30, 2020 14:40
@DuskEagle DuskEagle requested a review from a team as a code owner September 30, 2020 14:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg added the X-noremind Bots won't notify about PRs with X-noremind label May 6, 2021
@knz knz merged commit 918b694 into cockroachdb:release-20.2 May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X-noremind Bots won't notify about PRs with X-noremind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants