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

[cli] estimate-gc with custom TTL #31402

Merged
merged 1 commit into from Oct 18, 2018

Conversation

Projects
None yet
3 participants
@neeral
Contributor

neeral commented Oct 15, 2018

Release note:
cockroach debug estimate-gc now allows user to specify TTL period,
with a default of 24 hours.

@neeral neeral requested a review from cockroachdb/cli-prs as a code owner Oct 15, 2018

@cockroach-teamcity

This comment has been minimized.

Show comment
Hide comment
@cockroach-teamcity

cockroach-teamcity Oct 15, 2018

Member

This change is Reviewable

Member

cockroach-teamcity commented Oct 15, 2018

This change is Reviewable

@neeral

This comment has been minimized.

Show comment
Hide comment
@neeral
Contributor

neeral commented Oct 15, 2018

@nvanbenschoten

Thanks @neeral!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cli/debug.go, line 460 at r1 (raw file):

ranges individually.

Uses a hard-coded GC policy, with a default 24 hour TTL, for old versions.

This is no longer true, right? It now only uses the default TTL is one isn't provided.


pkg/cli/debug.go, line 471 at r1 (raw file):

	var rangeID roachpb.RangeID
	var gcTtlInSeconds int32 = 24 * 60 * 60 /* 1 day */

nit: (24 * time.Hour).Seconds() reads a little better.


pkg/cli/debug.go, line 476 at r1 (raw file):

		var err error
		if rangeID, err = parseRangeID(args[1]); err != nil {
			return err

Wrap these errors to give them some context.

@neeral

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cli/debug.go, line 460 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

This is no longer true, right? It now only uses the default TTL is one isn't provided.

A GC policy is defined by zones. We still have a hard-coded policy of a single zone. What's changed is the TTL for that zone.


pkg/cli/debug.go, line 476 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Wrap these errors to give them some context.

Done.

@nvanbenschoten

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cli/debug.go, line 460 at r1 (raw file):

Previously, neeral (Neeral Dodhia) wrote…

A GC policy is defined by zones. We still have a hard-coded policy of a single zone. What's changed is the TTL for that zone.

My issue is with the term "hard-coded". I'd say "configurable".


pkg/cli/debug.go, line 479 at r2 (raw file):

		}
		var gcTTLInSecondRangeID roachpb.RangeID
		if gcTTLInSecondRangeID, err = parseRangeID(args[2]); err != nil {

Why are we using parseRangeID for this? Let's just use strconv.ParseInt directly.

[cli] estimate-gc with custom TTL
Release note:
`cockroach debug estimate-gc` now allows user to specify TTL period,
with a default of 24 hours.
@neeral

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained


pkg/cli/debug.go, line 460 at r1 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

My issue is with the term "hard-coded". I'd say "configurable".

Fixed.


pkg/cli/debug.go, line 479 at r2 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Why are we using parseRangeID for this? Let's just use strconv.ParseInt directly.

I wanted to keep the logic for checking errors from strconv.ParseInt and whether int is positive. I've put this into a helper function.

@nvanbenschoten

:lgtm: thanks @neeral!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@craig

This comment has been minimized.

Show comment
Hide comment
@craig

craig bot Oct 18, 2018

👎 Rejected by code reviews

craig bot commented Oct 18, 2018

👎 Rejected by code reviews

@nvanbenschoten

This comment has been minimized.

Show comment
Hide comment
@nvanbenschoten

nvanbenschoten Oct 18, 2018

Member

bors r+

Member

nvanbenschoten commented Oct 18, 2018

bors r+

craig bot pushed a commit that referenced this pull request Oct 18, 2018

Merge #31402
31402: [cli] estimate-gc with custom TTL r=nvanbenschoten a=neeral

Release note:
`cockroach debug estimate-gc` now allows user to specify TTL period,
with a default of 24 hours.

Co-authored-by: neeral <neeral@users.noreply.github.com>
@craig

This comment has been minimized.

Show comment
Hide comment
@craig

craig bot commented Oct 18, 2018

Build succeeded

@craig craig bot merged commit 19a452b into cockroachdb:master Oct 18, 2018

2 of 3 checks passed

GitHub CI (Cockroach) TeamCity build started
Details
bors Build succeeded
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment