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

March 30, 2021

Get future release notes emailed to you:

Downloads

Warning:
The CockroachDB executable for Windows is experimental and not suitable for production deployments. Windows 8 or higher is required.
Warning:

Beta releases are intended for testing and experimentation only. Beta releases are not recommended for production use, as they can lead to data corruption, cluster unavailability, performance issues, etc.

Docker image

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

SQL language changes

Multi-region changes

General changes

  • CockroachDB now stores information about contention on non-SQL keys. #62041
  • Statement diagnostics bundles now contain output of EXPLAIN (VEC) and EXPLAIN (VEC, VERBOSE) commands for the statements. #62049
  • Sampled execution stats are now available through crdb_internal.node_{statement,transaction}_statistics. #62089
  • Increased the default value for the sql.txn_stats.sample_rate cluster setting from 0 to 0.1. This means that from now on every statement has 10% probability of being sampled for the purposes of execution statistics. Note that no other criteria for sampling (such as query latency) are currently being utilized to decide whether to sample a statement or not. #61815
  • Added the following cluster settings: sql.defaults.statement_timeout, which controls the default value for the statement_timeout session setting; sql.defaults.idle_in_transaction_session_timeout, which controls the default value for the idle_in_transaction_session_timeout timeout setting; sql.defaults.idle_in_session_timeout, which already existed, but is now a public cluster setting. #62182
  • EXPLAIN and EXPLAIN ANALYZE now show how long ago table statistics were collected. #61945

Command-line changes

  • Changed the formatting of namespace validation failures in cockroach debug doctor output. #62245

Bug fixes

  • Fixed a bug where the target column of crdb_internal.zones would show names without properly accounting for user-defined schemas. #62022
  • Added validation that prevents regions being dropped on multi-region databases when there are <= 3 regions left on the database. #62162
  • Fixed a bug where zone configurations were not being correctly dropped on the final DROP REGION of a multi-region database. #62162
  • Fixed a bug where VIEWs and SEQUENCEs were not being allowed in multi-region databases. They will now default to the REGIONAL BY TABLE locality. #62176
  • Fixed a bug where the pg_type_is_visible builtin function did not correctly handle user-defined types. #62225
  • Fixed a bug where casting an OID to a regtype did not work for user-defined types. #62225
  • A Raft leader who loses quorum will now relinquish its range lease and remove the replica if the range is recreated elsewhere, e.g. via Node.ResetQuorum(). #62103
  • Fixed a bug where ClearRange could leave behind stray write intents when separated intents were enabled, which could cause subsequent storage errors. #62104
  • ALTER TABLE, ALTER VIEW, and ALTER SEQUENCE can no longer be used to incorrectly create cross-DB references. #62341
  • Disallowed adding columns of type OIDVECTOR or INT2VECTOR to a table in ALTER TABLE ... ADD COLUMN statements. These types are not allowed in user-created tables via CREATE TABLE and were previously erroneously allowed in ALTER TABLE ... ADD COLUMN. #62180
  • CockroachDB now logs all unsupported pgdump statements across smaller log files that can be found in the subdirectory import<jobID>/(unsupported_schema_stmts|unsupported_data_stmts)/<filenum>.log #62263
  • Fixed a bug where a constraint like NOT NULL or CHECK on a column made irrelevant by a DROP CONSTRAINT statement in a later concurrent transaction would lead to errors / incorrect behaviour. #62249
  • Fixed an internal error that could occur when REGIONAL BY ROW tables were joined with other tables using a lookup or inverted join. The internal error was "we expect that limited UNION ALL queries are only planned locally". #62383
  • Fixed a bug where using DROP REGION on the last region of a multi-region database would not delete the global zone configurations for GLOBAL tables. #62220
  • Fixed a bug where duplicate IMPORT job records may have been created, or IMPORT statements may have failed, when the actual job succeeded. #62396
  • Fixed a bug where CockroachDB could collect execution statistics prematurely, which would result in incorrect stats (e.g. when running EXPLAIN ANALYZE). #62384
  • Fixed a bug where setting the kv.closed_timestamp.target_duration to 0 did not disable routing requests to follower replicas. #62439
  • Fixed a bug where a failed restore from a backup including user defined types would require manual cleanup. #62454

Contributors

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

  • Tharun
YesYes NoNo