What's New in v20.1.0-beta.2

March 2, 2020

Warning:

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.

In addition to various updates, enhancements, and bug fixes, this v20.1 beta release includes the ability to log slow SQL queries. By setting the sql.log.slow_query.latency_threshold cluster setting, each node of your cluster will log queries that exceed the specified service latency to a new file called cockroach-sql-slow.log.

Get future release notes emailed to you:

Downloads

Docker image

icon/buttons/copy
$ docker pull cockroachdb/cockroach-unstable:v20.1.0-beta.2

Security updates

  • Operators can now disable external HTTP access when performing certain operations (BACKUP, IMPORT, etc.). The external HTTP access, as well as custom HTTP endpoints, are disabled by providing an --external-io-disable-http flag. This flag provides a light-weight option to disable external HTTP access in environments where running a full-fledged proxy server may not be feasible. If running a proxy server is acceptable, operators may choose to start the cockroach binary while specifying the HTTP(S)_PROXY environment variable. #44900

General changes

  • Added a slow query log facility to CockroachDB, configurable by setting the sql.log.slow_query.latency_threshold cluster setting. When used, each node of your cluster will record queries that exceed the specified service latency to a new file called cockroach-sql-slow.log. #44816
  • New clusters will have a larger default range size of 512 MB, which will result in fewer ranges for the same amount of data. #45209

Enterprise edition changes

  • Row counts in BACKUP and RESTORE now include rows in system tables. #44965

SQL language changes

  • Disallowed changing the primary key of a table in the same transaction as its CREATE TABLE statement. #44815
  • Introduced the ability to create views using CREATE VIEW IF NOT EXISTS, which does nothing if the view already existed. #44913
  • If temporary table creation is enabled, users now have the ability to create temporary sequences as well. #44806
  • Added built-in support of hash-sharded indexes with new USING HASH WITH BUCKET_COUNT = <n> syntax for indices (including the primary index of a table). This feature allows users to easily relieve write hot-spots caused by sequential insert patterns at the cost of scan time for queries over the hashed dimension. #42922
  • Added support for primary key changes into hash sharded indexes. #44993
  • Disabled creating a hash sharded index that is also interleaved. #44996
  • An UPDATE returning a serialization failure error (code 40001) now leaves behind a lock, helping the transaction succeed if it retries. This prevents starvation of transactions where an UPDATE is prone to conflicts. #44654
  • Added a builtin function getdatabaseencoding(), which returns the current encoding name used by the database. #45129
  • The SQL:2008 syntax OFFSET <x> ROWS and FETCH FIRST <y> ROWS ONLY now accept parameter values. #45112
  • Disallowed primary key changes on tables that are currently undergoing a primary key change. #44784
  • Added support for the aggregate function corr() #44628
  • INSERT..ON CONFLICT index column names can now be specified in any order, rather than only in the same order as the index. #45280

Command-line changes

  • Previously, cockroach debug zip would only print an informational message about a piece of data it was retrieving after the data was retrieved (or an error was observed). This patch changes it to print a message beforehand as well. This enables better troubleshooting of hanging queries. #44342
  • cockroach debug zip now properly supports special characters in database and table names. #44342
  • cockroach debug zip will now apply the --timeout parameter to the SQL queries it performs (there was no timeout previously, causing cockroach debug zip to potentially hang). #44342
  • cockroach debug zip is now able to tolerate more forms of cluster unavailability. Nonetheless, in case system ranges are unavailable, it is recommended to run cockroach debug zip towards each node address in turn to maximize the amount of useful data collected. #44342
  • cockroach debug zip now includes secondary log files in the main log directory, for example the RocksDB logs. Log files in alternate log directories (e.g., --sql-audit-dir, if different from the main log directory) are not included. #45200

Admin UI changes

  • Changed Decommissioned Node History view to accommodate the case when there are no decommissioned nodes. #44205
  • Changed styling of the Cluster Overview view. #44212
  • Endpoint /_status/registry/{node_id} will now display status info about the jobs running on this node_id. #45030
  • The "Log file list" endpoint now includes secondary log files in the main log directory, for example the RocksDB logs. Log files in alternate log directories (e.g., --sql-audit-dir, if different from the main log directory) are not included. #45200

Bug fixes

  • Fixed a bug where CockroachDB could return an internal error on the queries that return INT columns when the default integer size has been changed. #44930
  • Fixed a bug where CockroachDB could crash when running EXPLAIN (VEC) in some edge cases. Now, an internal error is returned instead. #44931
  • Fixed a bug where CockroachDB would return an internal error when the merge join operation was performed via the vectorized execution engine in a case when two sides of the join had comparable but different types in the equality columns (for example, INT2 on the left and INT4 on the right). #44942
  • Fixed internal query errors in some cases involving negative limits. #45009
  • Fixed a bug where the distinct operation in the row execution engine would fail to properly account for its memory usage, potentially leading to OOMs on large tables. #45254
  • Correctly handle Avro byte datums when converting them to the expected string column families (such as VARCHAR, CHAR, etc.). #45242
  • Fixed a potential error occurring when loading the movr dataset with a large number of rows in the promo codes column. #45035

Performance improvements

  • The cost-based-optimizer now generates faster execution plans in some cases that involve IN / NOT IN with an empty tuple (or = ANY with an empty array). #45170

Doc updates

Contributors

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

  • Andrii Vorobiov
  • Artem Barger (first-time contributor)
  • Jaewan Park
  • abhishek20123g (first-time contributor)

Yes No

Yes No