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
$ docker pull cockroachdb/cockroach-unstable:v21.1.0-beta.2
SQL language changes
Multi-region changes
- Added validation that prevents users from updating the zone configurations of multi-region tables without first setting the
override_multi_region_zone_config
session variable. #62119 - Discarding a zone configuration from a multi-region enabled entity is blocked behind the
override_multi_region_zone_config
session variable. #62159 - Reverted the change that added the
FORCE
keyword in #61499 in favor of theoverride_multi_region_zone_config
session variable. #62119 - Setting non-multi-region controlled fields on zone configs before
ALTER DATABASE ... SET PRIMARY REGION
will now be preserved and have the same value after theSET PRIMARY REGION
command is issued. #62162 - Materialized views in multi-region databases will now have a
GLOBAL
table locality. #62194 - Materialized views which are in a database before the first
ADD REGION
will becomeGLOBAL
onADD REGION
, in line with the behavior ofCREATE MATERIALIZED VIEW
on a multi-region database. #62194 ALTER DATABASE .. SET PRIMARY REGION
now requires bothCREATE
andZONECONFIG
privilege on all objects inside the database when adding the first region to the database. The same behavior applies for dropping the last region usingALTER DATABASE ... DROP REGION
. #62450- Removed the experimental multi-region locality syntaxes. #62114
General changes
- CockroachDB now stores information about contention on non-SQL keys. #62041
- Statement diagnostics bundles now contain output of
EXPLAIN (VEC)
andEXPLAIN (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 thestatement_timeout
session setting;sql.defaults.idle_in_transaction_session_timeout
, which controls the default value for theidle_in_transaction_session_timeout
timeout setting;sql.defaults.idle_in_session_timeout
, which already existed, but is now a public cluster setting. #62182 EXPLAIN
andEXPLAIN 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 ofcrdb_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
VIEW
s andSEQUENCE
s were not being allowed in multi-region databases. They will now default to theREGIONAL 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 aregtype
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
, andALTER SEQUENCE
can no longer be used to incorrectly create cross-DB references. #62341- Disallowed adding columns of type
OIDVECTOR
orINT2VECTOR
to a table inALTER TABLE ... ADD COLUMN
statements. These types are not allowed in user-created tables viaCREATE TABLE
and were previously erroneously allowed inALTER TABLE ... ADD COLUMN
. #62180 - CockroachDB now logs all unsupported
pgdump
statements across smaller log files that can be found in the subdirectoryimport<jobID>/(unsupported_schema_stmts|unsupported_data_stmts)/<filenum>.log
#62263 - Fixed a bug where a constraint like
NOT NULL
orCHECK
on a column made irrelevant by aDROP 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 forGLOBAL
tables. #62220 - Fixed a bug where duplicate
IMPORT
job records may have been created, orIMPORT
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