Skip to content

sql: make crdb_internal.check_consistency a table generator#36320

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
andreimatei:sql.check_consistency-set-function
Apr 1, 2019
Merged

sql: make crdb_internal.check_consistency a table generator#36320
craig[bot] merged 2 commits intocockroachdb:masterfrom
andreimatei:sql.check_consistency-set-function

Conversation

@andreimatei
Copy link
Copy Markdown
Contributor

Generate rows instead of an array of tuples. Much easier to use.

Release note: None

@andreimatei andreimatei requested review from a team and tbg March 29, 2019 03:45
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 4 of 4 files at r1, 3 of 3 files at r2.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @andreimatei)


docs/generated/sql/functions.md, line 650 at r1 (raw file):

<thead><tr><th>Function &rarr; Returns</th><th>Description</th></tr></thead>
<tbody>
<tr><td><code>crdb_internal.check_consistency(stats_only: <a href="bool.html">bool</a>, start_key: <a href="bytes.html">bytes</a>, end_key: <a href="bytes.html">bytes</a>) &rarr; tuple{int AS range_id, bytes AS start_key, string AS start_key_pretty, string AS status, string AS detail}</code></td><td><span class="funcdesc"><p>Runs a consistency check on ranges touching the specified key range. an empty start or end key is treated as the minimum and maximum possible, respectively. stats_only should only be set to false when targeting a small number of ranges to avoid overloading the cluster. The return value is an array of tuples, with each tuple consisting of the range ID, the status (a roachpb.CheckConsistencyResponse_Status), and verbose detail.</p>

Isn't it weird that this is now documented here?


pkg/sql/sem/builtins/generator_builtins.go, line 198 at r1 (raw file):

				"an empty start or end key is treated as the minimum and maximum possible, "+
				"respectively. stats_only should only be set to false when targeting a "+
				"small number of ranges "+"to avoid overloading the cluster. The return "+

weird concat when you don't have a newline

Generate rows instead of an array of tuples. Much easier to use.

Release note: None
So it doesn't need to go through a Txn just to get a DB.

Release note: None
@andreimatei andreimatei force-pushed the sql.check_consistency-set-function branch from 74753fe to 8315306 Compare April 1, 2019 16:07
Copy link
Copy Markdown
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

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


docs/generated/sql/functions.md, line 650 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

Isn't it weird that this is now documented here?

good eye. Massaged it to move back to the sys functions.


pkg/sql/sem/builtins/generator_builtins.go, line 198 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

weird concat when you don't have a newline

done

craig bot pushed a commit that referenced this pull request Apr 1, 2019
36320: sql: make crdb_internal.check_consistency a table generator r=andreimatei a=andreimatei

Generate rows instead of an array of tuples. Much easier to use.

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Apr 1, 2019

Build succeeded

@craig craig bot merged commit 8315306 into cockroachdb:master Apr 1, 2019
@andreimatei andreimatei deleted the sql.check_consistency-set-function branch April 2, 2019 18:41
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.

3 participants