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

sql: Reorder show ranges output to be clearer #40501

Merged
merged 1 commit into from
Sep 5, 2019

Conversation

rohany
Copy link
Contributor

@rohany rohany commented Sep 5, 2019

The output of show ranges had column orderings that at a quick glance
could lead to users making the wrong conclusions about their
partitioning setup. This PR adjusts the columns and adds more readily
accessible information about the lease_holder node's locality.

Fixes #40467.

Release note (sql change): Reorder columns in show ranges output

@rohany rohany requested review from solongordon and a team September 5, 2019 02:46
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rohany and @solongordon)


pkg/sql/show_ranges_test.go, line 43 at r1 (raw file):

	replicas := make([]int, 3)

	q := `SELECT replicas, replica_localities from [SHOW RANGES FROM TABLE t]`

Please make sure the leaseholder locality column is also tested, either here or in a logic test or both.


pkg/sql/delegate/show_ranges.go, line 46 at r1 (raw file):

			range_size / 1000000 as range_size_mb,
			lease_holder,
      replica_localities[1] as lease_holder_locality,

Wait, is replica_localities[1] really the leaseholder locality? That seems arbitrary and incorrect to me unless I'm missing something.

Also... whitespace. 😛

Copy link
Contributor Author

@rohany rohany left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @solongordon)


pkg/sql/show_ranges_test.go, line 43 at r1 (raw file):

Previously, solongordon (Solon) wrote…

Please make sure the leaseholder locality column is also tested, either here or in a logic test or both.

done


pkg/sql/delegate/show_ranges.go, line 46 at r1 (raw file):

Previously, solongordon (Solon) wrote…

Wait, is replica_localities[1] really the leaseholder locality? That seems arbitrary and incorrect to me unless I'm missing something.

Also... whitespace. 😛

yeah you're right, I'm wrong here. For some reason I had it in my mind that the leaseholder was the first thing in the replicas list.

@rohany rohany force-pushed the show-ranges-output branch 2 times, most recently from 493d2ae to 54eb496 Compare September 5, 2019 17:06
The output of show ranges had column orderings that at a quick glance
could lead to users making the wrong conclusions about their
partitioning setup. This PR adjusts the columns and adds more readily
accessible information about the lease_holder node's locality.

Fixes cockroachdb#40467.

Release note (sql change): Reorder columns in show ranges output
@rohany
Copy link
Contributor Author

rohany commented Sep 5, 2019

someone fix my goland to do whitespace correctly

Copy link
Contributor

@solongordon solongordon left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rohany and @solongordon)


pkg/sql/delegate/show_ranges.go, line 46 at r1 (raw file):

Previously, rohany (Rohan Yadav) wrote…

yeah you're right, I'm wrong here. For some reason I had it in my mind that the leaseholder was the first thing in the replicas list.

Great, makes more sense now.

I think if you convert all the tabs to spaces in these strings the whitespace gods will be appeased.

@rohany
Copy link
Contributor Author

rohany commented Sep 5, 2019

bors r+

craig bot pushed a commit that referenced this pull request Sep 5, 2019
40501: sql: Reorder show ranges output to be clearer r=rohany a=rohany

The output of show ranges had column orderings that at a quick glance
could lead to users making the wrong conclusions about their
partitioning setup. This PR adjusts the columns and adds more readily
accessible information about the lease_holder node's locality.

Fixes #40467.

Release note (sql change): Reorder columns in show ranges output

40519: workload: ignore syntax error on INJECT STATISTICS against v2.0 r=nvanbenschoten a=nvanbenschoten

Fixes #40463.

Release note: None

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
@craig
Copy link
Contributor

craig bot commented Sep 5, 2019

Build succeeded

@craig craig bot merged commit 5f8a9d7 into cockroachdb:master Sep 5, 2019
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.

sql: improve output of show ranges
3 participants