Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
40493: sql: Display inherited constraints in SHOW PARTITIONS  r=andreimatei a=rohany

SHOW PARTITIONS now displays the inherited zone configuration of the
partitions in a separate column. To accomplish this, the
crdb_internal.zones table now holds on to the inherited constraints of
each zone in a separate column. Additionally, the
crdb_internal.partitions table holds on to the zone_id and subzone_id of
the zone configuration the partition refers to. These id's correspond to
the zone configuration at the lowest point in that partitions
"inheritance chain".

Release justification: Adds a low risk, good to have UX feature.

Fixes #40349.

Release note (sql change):
* SHOW PARTITIONS now displays inherited zone configurations.
* Adds the zone_id, subzone_id columns to crdb_internal.partitions,
which form a link to the corresponding zone config in
crdb_internal.zones which apply to the partitions.
* Rename the config_yaml, config_sql and config_proto columns in
crdb_internal.zones to raw_config_yaml, raw_config_sql,
raw_config_proto.
* Add the columns full_config_sql and full_config_yaml to the
crdb_internal.zones table which display the full/inherited zone
configuration.

41138: movr: Add stats collection to movr workload run r=danhhz a=rohany

This PR adds tracking stats for each kind of query in the movr workload
so that output is displayed from cockroach workload run. Additionally,
this refactors the movr workload to define the work as functions on a
worker struct. This hopefully will avoid a common gotcha of having
different workers sharing the same not threadsafe histograms object.

Release justification: low risk nice to have feature

Release note: None

41196: store,bulk: log when delaying AddSSTable, collect + log more timings in bulk-ingest r=dt a=dt

storage: log when AddSSTable requests are delayed

If the rate-limiting and back-pressure mechanisms kick in, they can dramatically delay requests in some cases.
However there is currently it can be unclear that this is happening and the system may simply appear slow.
Logging when requests are delayed by more than a second should help identify when this is the cause of slowness.

Release note: none.

Release justification: low-risk (logging only) change that could significantly help in diagnosing 'stuck' jobs based on logs (which often all we have to go on).

bulk: track and log more timings

This tracks and logs time spent in the various stages of ingestion - sorting, splitting and flushing.
This helps when trying to diagnose why a job is 'slow' or 'stuck'.

Release note: none.

Release justification: low-risk (logging only) changes that improve ability to diagnose problems.


Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: Rohan Yadav <rohany@cockroachlabs.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
  • Loading branch information
4 people committed Sep 30, 2019
4 parents 29c2464 + a7a8fe6 + 460f9e7 + ea0b462 commit d1f5ea4
Show file tree
Hide file tree
Showing 25 changed files with 1,118 additions and 428 deletions.
22 changes: 22 additions & 0 deletions pkg/base/zone.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2019 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package base

// SubzoneID represents a subzone within a zone. It's the subzone's index within
// the parent zone + 1; there's no subzone 0 so that 0 can be used as a
// sentinel.
type SubzoneID uint32

// SubzoneIDFromIndex turns a subzone's index within its parent zone into its
// SubzoneID.
func SubzoneIDFromIndex(idx int) SubzoneID {
return SubzoneID(idx + 1)
}
28 changes: 15 additions & 13 deletions pkg/ccl/logictestccl/testdata/logic_test/crdb_internal
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# LogicTest: local

query IITTITTT colnames
query IITTITTTII colnames
SELECT * FROM crdb_internal.partitions
----
table_id index_id parent_name name columns column_names list_value range_value
table_id index_id parent_name name columns column_names list_value range_value zone_id subzone_id

statement ok
CREATE TABLE t1 (
Expand Down Expand Up @@ -33,16 +33,18 @@ CREATE table t2 (a STRING PRIMARY KEY) PARTITION BY LIST (a) (
PARTITION pfoo VALUES IN ('foo')
)

query IITTITTT
# Since there are no zone configurations on any of these partitions, tables,
# or databases, these partitions inherit directly from the default config.
query IITTITTTII
SELECT * FROM crdb_internal.partitions ORDER BY table_id, index_id, name
----
53 1 NULL p12 1 a (1), (2) NULL
53 1 p12 p12p3 1 b (3) NULL
53 1 p12p3 p12p3p8 1 c (8) NULL
53 1 NULL p6 1 a (6) NULL
53 1 p6 p6p7 1 b NULL (MINVALUE) TO (7)
53 1 p6 p6p8 1 b NULL (7) TO (8)
53 1 p6 p6px 1 b NULL (8) TO (MAXVALUE)
53 1 p12 pd 1 b (DEFAULT) NULL
53 2 NULL p00 2 a, b (0, 0) NULL
54 1 NULL pfoo 1 a ('foo') NULL
53 1 NULL p12 1 a (1), (2) NULL 0 0
53 1 p12 p12p3 1 b (3) NULL 0 0
53 1 p12p3 p12p3p8 1 c (8) NULL 0 0
53 1 NULL p6 1 a (6) NULL 0 0
53 1 p6 p6p7 1 b NULL (MINVALUE) TO (7) 0 0
53 1 p6 p6p8 1 b NULL (7) TO (8) 0 0
53 1 p6 p6px 1 b NULL (8) TO (MAXVALUE) 0 0
53 1 p12 pd 1 b (DEFAULT) NULL 0 0
53 2 NULL p00 2 a, b (0, 0) NULL 0 0
54 1 NULL pfoo 1 a ('foo') NULL 0 0
Loading

0 comments on commit d1f5ea4

Please sign in to comment.