June 14, 2021
- For a comprehensive summary of features in v20.2, see the v20.2 GA release notes.
- To upgrade to v20.2, see Upgrade to CockroachDB v20.2.
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.
Docker image
$ docker pull cockroachdb/cockroach:v20.2.11
SQL language changes
- Floating point infinity values are now formatted as
Infinity
(or-Infinity
if negative). This is for compatibility with PostgreSQL #65105 INSERT INTO ... ON CONFLICT ... DO UPDATE SET
statements without predicates now acquire locks using theFOR UPDATE
locking mode during their initial row scan, which improves performance for contended workloads. This behavior is configurable using theenable_implicit_select_for_update
session variable and the [sql.defaults.implicit_select_for_update.enabled
cluster setting].(../v20.2/cluster-settings.html) #65364- The
ST_GeomFromGeoJSON(string)
spatial function is now marked as the preferred overload, meaning it will resolve correctly in more contexts. #65441 - The cancellation behavior for DistSQL flows has been improved. #65046
DB Console changes
- Fixed a bug where empty series would show up in metrics graphs and legends, and when data was incorrectly attributed to the wrong nodes on graphs for clusters with decommissioned nodes. #66034
- Removed shading on line graphs, which improves legibility when viewing more than a few series on the same plot. #66034
- Drag to zoom on metrics graphs now supports time ranges under 10 minutes. #66034
Bug fixes
BACKUP
no longer resolves intents one by one. This eliminates the need to run a high-priority query to clean up intents to unblockBACKUP
in case of intent buildup. #64931- Fixed a bug that could cause backups to be slower.
LockTableWaiter
now checks the finalized transaction cache before pushing transactions to avoid duplicating work. #64999 - Fixed a bug where interval math on a
TIMESTAMPTZ
on a DST boundary would incorrectly add or subtract an extra hour. #65097 - Fixed a bug where
date_trunc
on aTIME
value on a DST boundary could switch timezones and produce the incorrect result. #65097 - Fixed a bug causing the
ZONECONFIG
privilege on tables and databases to be incorrectly interpreted asUSAGE
, which could corrupt a table and/or database becauseUSAGE
is an invalid privilege for tables and databases. Also fixed the case when theZONECONFIG
privilege would be incorrectly restored asUSAGE
for tables and databases created and backed up in v20.1 and then restored through a full clusterRESTORE
in v20.2 or later. #65159 - Fixed a bug which could cause a panic when running an
EXECUTE
of a previously prepared statement with aREGCLASS
orREGTYPE
parameter or a user-defined type argument after runningBEGIN AS OF SYSTEM TIME
with an invalid timestamp. #65150 - Fixed a bug which could cause a panic when issuing a query referencing a user-defined type as a placeholder. #65151
- Fixed a bug introduced in v20.2 that caused rows to be incorrectly de-duplicated from a scan with a non-unique index. #65288
- Fixed a bug causing
revision_history
cluster backups to not include dropped databases. This means that, previously, dropped databases could not be restored from backups that were taken after the database was dropped. #65317 - Fixed a bug where empty zone configurations get created for certain indexes during
ALTER PRIMARY KEY
. #65175 - Fixed a bug causing
SHOW CREATE TABLE
output to not display the zone configurations of a table or index if there were no partitions, even if there were zone configurations on the index or table. #65175 - Fixed a bug where
ALTER DATABASE ... SET OWNER ...
did not work if the database name was a keyword. #65367 - Fixed a bug where
SHOW CREATE TABLE
would show the zone configurations of a table with the same name from a different schema. #65369 - Previously, CockroachDB would crash when attempting to create a table using
CREATE TABLE ... AS
syntax whereAS
selects fromcrdb_internal.node_statement_statistics
,crdb_internal.node_transaction_statistics
, orcrdb_internal.node_txn_stats
virtual tables. #65544 - Fixed a bug where binary
TIMETZ
values were not being decoded correctly when sent as a parameter in the wire protocol. #65579 - A certain percentage of cases in which a node could have served a follower read were not handled correctly, resulting in the node routing the request to another nearby node for no reason. This has been fixed. #65470
- Fixed a race condition during transaction cleanup that could leave old transaction records behind until MVCC garbage collection. #65384
- Improved transaction cleanup for disconnected clients to reduce intent buildup. #65384
- Fixed a bug where the storage layer would under some rare write-heavy workloads start off by writing
SSTable
files that were too small for CockroachDB to manage effectively. The storage layer now creates fewer, larger files under those workloads, in line with expected behavior. #65481 - Scheduled backups with interleaved tables can now be created with the
include_deprecated_interleaves
option. #65730 - Calling
get_bit
orset_bit
on a byte array argument now goes to the correct index of the underlying bitstring, which matches the Postgres behavior. #65787 - Previously,
ALTER DATABASE ... CONVERT TO SCHEMA
could potentially leave the schema with invalid privileges thus causing the privilege descriptor to be invalid. #65813 - Fixed a scenario in which a rapid sequence of splits could trigger a storm of Raft snapshots. This would be accompanied by log messages of the form
would have dropped incoming MsgApp, but allowing due to ...
, which tended to occur as part ofRESTORE
/IMPORT
operations. #65500 - Previously, a schema's privilege descriptor could become corrupted upon executing
ALTER DATABASE ... CONVERT TO SCHEMA
. This is due to privileges that are invalid on a schema being copied over to the schema, rendering the schema unusable due to invalid privileges. #65999 - Previously,
TRUNCATE
transactionally scanned the meta range to find ranges to unsplit, creating contention withTRUNCATE
's new behavior of preserving splits. #65942 - Fixed the error classification for duplicate index names where the later index was a
UNIQUE
index. #64002 - Fixed the error classification for
ALTER TABLE ... ADD CONSTRAINT ... UNIQUE
with the same name as an existing index. #64002 - Fixed a bug in
SHOW RANGES
that misattributed localities to nodes when using multiple stores. #66038 - Fixed a bug where incremental backups with
revision_history
would sometimes fail if a view was altered between incremental backups. #66072
Performance improvements
- Fixed an issue in the optimizer that prevented spatial predicates of the form
(column && value) = true
from being index-accelerated. These queries can now use a spatial index, if one is available. #65988
Contributors
This release includes 55 merged PRs by 32 authors. We would like to thank the following contributors from the CockroachDB community:
- Max Neverov
- Mohammad Aziz (first-time contributor)