What's New in v20.1.0-rc.1

This version of CockroachDB is no longer supported. For more details, see the Release Support Policy.

April 14, 2020


A denial-of-service (DoS) vulnerability is present in CockroachDB v20.1.0 - v20.1.10 due to a bug in protobuf. This is resolved in CockroachDB v20.1.11 and later releases. When upgrading is not an option, users should audit their network configuration to verify that the CockroachDB HTTP port is not available to untrusted clients. We recommend blocking the HTTP port behind a firewall.

For more information, including other affected versions, see Technical Advisory 58932.

Get future release notes emailed to you:


Docker image

$ docker pull cockroachdb/cockroach-unstable:v20.1.0-rc.1

Security updates

  • The new --unencrypted-localhost-http flag for cockroach start and cockroach start-single-node forces the HTTP listener to bind to localhost addresses only and disables the TLS protocol. In secure clusters, this makes the Admin UI reachable with an http:// URL without requiring certificate or CA setup. #46472

General changes

  • Transactions reading a lot of data behave better when exceeding the memory limit set by the kv.transaction.max_refresh_spans_bytes cluster setting. Such transactions now attempt to resolve the conflicts they run into instead of being forced to always retry. Increasing kv.transaction.max_refresh_spans_bytes should no longer be necessary for most workloads. #46803
  • Before upgrading from v19.2 to v20.1, it is best practice to make sure there are no schema changes in progress. However, if any are still running when the upgrade is started, note that they will stop making progress during the upgrade and will run to completion once the upgrade has been finalized. #47073

Enterprise edition changes

SQL language changes

  • Outer columns (columns in a subquery that reference a higher scope) can now be used in the SELECT list of an aggregation or grouping expression without explicitly including them in the GROUP BY list, for improved Postgres compatibility. #46417
  • Renamed the EXPLAIN BUNDLE statement to EXPLAIN ANALYZE (DEBUG). #46534
  • The EXPLAIN ANALYZE (DEBUG) statement now contains all the information available via EXPLAIN (OPT,ENV). #46441
  • The length(), octet_length() and bit_length() built-in functions are now supported on BIT and VARBIT. #46524
  • The EXPLAIN ANALYZE response now includes memory and disk usage details and omits allocation stats if they are zero. #46316
  • The CREATE TEMPORARY TABLE statement now supports the ON COMMIT syntax. #46594
  • The IMPORT statement now records additional anonymous telemetry about its performance and reliability. #46763
  • CREATE INDEX CONCURRENTLY and DROP INDEX CONCURRENTLY are now supported as no-ops, as all indexes are created concurrently. #46802
  • The type checking code now prefers aggregate overloads with string inputs if there are multiple possible candidates due to arguments of unknown type. #46898
  • Added an unimplemented error when attempting to ADD CONSTRAINT with the EXCLUDE USING syntax. #46909
  • Added support for CREATE INDEX .... INCLUDE (col1, col2, ...), which is an alias that PostgreSQL uses that is analogous to CockroachDB's STORING (col1, col2, ...) syntax. #46909
  • Added support for parsing the REINDEX syntax, which results in an unimplemented error that explains that REINDEXing is not required in CockroachDB. #46909
  • The vectorized execution engine now only runs queries with streaming operators. To enable vectorized execution for buffering operators, use SET vectorize=on. #46925
  • The EXPLAIN response now shows SPANS | FULL SCAN for full table scans and SPANS | LIMITED SCAN if there is a limit. Previously, both cases would return SPANS | ALL. #47013
  • The CREATE ROLE/ALTER ROLE/DROP ROLE results no longer show the rows affected, as this number could be misleading. #46819
  • Added a hint to use ALTER ROLE when trying to GRANT a role option directly to a user using the GRANT ROLE syntax. #46819
  • Improved theĀ error message for ALTER COLUMN ... SET DATA TYPE for data type conversions that involve overwriting existing values. #47170

Command-line changes

  • The cockroach commands that internally use SQL, including cockroach sql and cockroach demo, now can connect to a server using a unix datagram socket. The syntax for this is --url 'postgres://user@?host=/path/to/directory?port=NNNN'. #47007
  • The cockroach workload command now sets its application_name based on the chosen workload. #46546
  • The cockroach debug zip command now creates valid zip files even if some of its requests encounter an error. #46634
  • The cockroach demo command now displays a TCP-based connection URL and unix datagram socket for each node of a demo cluster. #46935
  • It is now possible to pre-configure the secure mode of cockroach demo using the COCKROACH_INSECURE environment variable like other client commands. #46959
  • When running cockroach demo in secure mode, the generated SQL URL now embeds the password so that commands using this URL can run without a request for password. #47007
  • The SQL URL generated by cockroach demo no longer requires TLS client certificates in particular directory locations. #47007
  • The new experimental client-side command \demo ls for cockroach demo displays the connection parameters for every node in a demo cluster. #47007
  • The client-side commands specific to cockroach demo, starting with \demo, are now advertised in the output of \?. Note that this feature is currently experimental. #47007

Admin UI changes

  • The ALL filter on the Statements page now excludes internal statements. #45646
  • Tooltips showing statements and jobs are now limited in size for very long statements. #46982
  • The default timescale on metrics pages is now 10 minutes. Previously, the timescale defaulted to the age of the longest running node. #46980
  • Improved tooltips for existing capacity and storage metrics. #46987
  • Added analytics tracking for table sorts, searches and diagnostics activation on the Statements page, and navigation on the Statement Details page. #47003
  • The download link for statement diagnostics now points to the bundle zip file. #47016
  • Removed the Statements tab from the Databases > Table Details page. #47102
  • Cleaned up barcharts on the Statements page. #47129

Bug fixes

  • Fixed an Admin UI bug where sort columns were only being applied per-page instead of for the entire multi-page list of statements #46978
  • Fixed a performance bug where truncate would take 2*num columns + 2*num indexes round trips. This could lead to slow truncate performance in distributed clusters. #46334
  • It is no longer possible to inject stats within an explicit transaction. #46567
  • Casting a bit array to a bigger varbit array no longer adds extra 0 padding at the end. #46532
  • Fixed a bug where pg_catalog.pg_indexes showed the wrong index definition for inverted indexes. #46527
  • Fixed incorrect query results in some corner cases involving variance/stddev/corr. #46436
  • Fixed an internal error or incorrect evaluation of check constraints in certain cases involving UPSERT and foreign key checks. #46409
  • cockroach debug zip now properly collects heap profiles. #46469
  • The goroutine dump facility now functions properly when logging to files is disabled, e.g., via --log-dir="" or --logtostderr. #46469
  • Fixed an internal error that could occur during planning for some queries with a join and negative LIMIT. #46440
  • Fixed a bug where the vectorized engine could sometimes give an incorrect result when reading from interleaved parents or children. #46456
  • Fixed a bug where the vectorized engine would throw an internal error when executing a query that utilized an inverted index. #46267
  • Fixed a bug where operations on an index that contained a collated string in descending order would fail. #46570
  • Fixed a bug with SET TIME ZONE, where a string prefixed with UTC or GMT and with time zones with colons had it's offset inverted the wrong way. #46510
  • CockroachDB no longer incorrectly accounts for some RAM usage when computing aggregate functions. #46545
  • SHOW INDEXES ... WITH COMMENT no longer shows duplicate rows for certain tables if indexes are identically named. #46621
  • Fixed an internal error that could happen during planning when a column with a histogram was filtered with a predicate of a different data type. #46552
  • Scans that lock rows (via FOR UPDATE) are no longer elided when the results are unused. #46676
  • Fixed a bug (introduced in v20.1.0-beta.3) in the new schema change GC job implementation which would cause the execution of GC jobs to be incorrectly delayed in the presence of other table descriptor updates. #46691
  • Fixed a bug with distinct aggregations on JSONB columns. #46711
  • Fixed a rare bug causing the assertion failure "caller violated contract: discovered non-conflicting lock". #46744
  • Ensured that index and table GC happen closer to their GC deadline. #46743
  • Statement diagnostics created through EXPLAIN ANALYZE (DEBUG) now show up in the UI page. #46804
  • Benign "outbox next" errors are now only logged when log verbosity is set to 1 or greater. #46838
  • Failed or canceled IMPORTs now properly clean up partially imported data. #46856
  • Failed or canceled RESTOREs now properly clean up partially imported data. #46855
  • Fixed a rare bug causing errors to be returned for successfully committed transactions. The most common error message was "TransactionStatusError: already committed". #46848
  • The "insecure cluster" indicator is once again displayed at the top right of Admin UI for insecure clusters. #46865
  • Fixed a rare assertion failure that contained the text "existing lock cannot be acquired by different transaction". This assertion was only present in earlier v20.1 releases and not in any earlier releases. #46896
  • Fixed an incorrect query result that could occur when a scalar aggregate was called with a null input. #46898
  • Fixed incorrect result with count(*) when grouping on constant columns. #46891
  • cockroach demo now properly cleans up its temporary files if the background license acquisition fails. #47007
  • Tooltips for statement diagnostics are now only shown on hover. #46995
  • Fixed a bug when queries with projections of only INT2 and/or INT4 columns were executed via the vectorized engine. #46977
  • CockroachDB no longer considers a non-NULL value from an interleaved parent table to be NULL when the interleaved child has a NULL value in the row with the corresponding index key. #47103
  • Incremental, full-cluster BACKUPs with revision history are no longer disallowed in some cases where system tables have changed. #47132
  • Fixed a bug when adding a self-referencing foreign key constraint in the same transaction that creates a table. #47128
  • Change data capture no longer combines with long running transactions to trigger an assertion with the text "lock timestamp regression". #47139
  • As part of migrating to the new schema change job implementation in 20.1, failed IMPORT and RESTORE jobs that left behind table data in 19.2 that had not been completely garbage collected by the time the cluster was upgraded to 20.1 will now have GC jobs automatically created for them. #47144
  • Fixed a bug preventing clusters from creating TIMETZ columns before an upgrade to v20.1 is finalized. #47169
  • Fixed a data race on AST nodes for SELECT statements that include a WINDOW clause. #47175
  • Fixed the behavior of crdb_internal.zones in mixed-version clusters. #47236
  • Fixed reads from system.namespace and crdb_internal.zones on 19.2 nodes in a mixed-version cluster. #47236
  • Fixed incompatibility with v19.2 nodes for tables with computed columns. #47274
  • Restoring a backup from v2.1 to v20.1 with a timestamp column no longer results in incomplete type data. #47240
  • Fixed some cases where limits were applied incorrectly when pushed down into scans (resulting in some queries returning more results than they should). #47296
  • Fixed an assertion failure with the text "expected latches held, found none". #47301

Performance improvements

  • Improved execution plans involving filters with OR expressions. #46371
  • Improved execution plans for queries containing a division by a constant. #46861
  • Virtual tables that access all table descriptors now make fewer round trips. #46949

Build changes

  • Building from source now requires Go 1.13.19. #46619
  • It is now possible to build CockroachDB with the Clang++ v10 compiler. #46860

Doc updates


This release includes 173 merged PRs by 32 authors. We would like to thank the following contributors from the CockroachDB community:

  • Andrii Vorobiov
  • Shaker Islam (first-time contributor)
YesYes NoNo