What's New in v21.1.11

October 18, 2021

Get future release notes emailed to you:


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:v21.1.11

Enterprise edition changes

SQL language changes

  • Added crdb_internal.(node|cluster)_distsql_flows virtual tables that expose the information about the flows of the DistSQL execution scheduled on remote nodes. These tables do not include information about the non-distributed queries nor about local flows (from the perspective of the gateway node of the query). #66332
  • Added new metrics to track a schema job failure (sql.schema_changer.errors.all, sql.schema_changer.errors.constraint_violation, sql.schema_changer.errors.uncategorized), with errors inside the crdb_internal.feature_usage table. #70621
  • Fixed a bug where LINESTRINGZ, LINESTRINGZM, and LINESTRINGM could not be used as column types. #70749

Operational changes

  • Added the cluster settings sql.defaults.transaction_rows_written_log, sql.defaults.transaction_rows_written_err, sql.defaults.transaction_rows_read_log, and sql.defaults.transaction_rows_read_err (as well as the corresponding session variables). These settings determine the "size" of the transactions in written and read rows that are logged to the SQL_PERF logging channel. Note that the internal queries used by CockroachDB cannot error out, but can be logged instead to the SQL_INTERNAL_PERF logging channel. The "written" limits apply to INSERT, INSERT INTO SELECT FROM, INSERT ON CONFLICT, UPSERT, UPDATE, and DELETE whereas the "read" limits apply to SELECT statements, in addition to all of the others listed. These limits will not apply to CREATE TABLE AS SELECT, IMPORT, TRUNCATE, DROP TABLE, ALTER TABLE, BACKUP, RESTORE, or CREATE STATISTICS statements. Note that enabling the transaction_rows_read_err setting comes at the cost of disabling the usage of the auto commit optimization for the mutation statements in implicit transactions. #70175
  • Adjusted the meaning of the recently introduced session variables transaction_rows_written_err and transaction_rows_read_err (as well as the corresponding _log variables) to indicate the largest number of rows that is still allowed. Prior to this change, reaching the limit would result in an error; now an error results only if the limit is exceeded. #70175
  • Added the session variable large_full_scan_rows, as well as the corresponding cluster setting sql.defaults.large_full_scan_rows. This setting determines which tables are considered "large" for the purposes of enabling the disallow_full_table_scans feature to reject full table/index scans of such "large" tables. The default value for the new setting is 0, meaning that the previous behavior of rejecting all full table/index scans is kept. Internally-issued queries aren't affected, and the new setting has no impact when the disallow_full_table_scans setting is not enabled. #70294
  • CockroachDB now records a log event and increments a counter when removing an expired session. #68538

Command-line changes

DB Console changes

Bug fixes

  • Fixed a bug where cluster revision history backups may have included dropped descriptors in the "current" snapshot of descriptors on the cluster. #69650
  • Fixed a regression in statistics estimation in the optimizer for very large tables. The bug, which has been present since v20.2.14 and v21.1.7, could cause the optimizer to severely underestimate the number of rows returned by an expression. #69953
  • Fixed a bug that can cause prolonged unavailability due to lease transfer of a replica that may be in need of a Raft snapshot. #69964
  • Fixed a bug where, after a temporary node outage, other nodes in the cluster could fail to connect to the restarted node due to their circuit breakers not resetting. This would manifest in the logs via messages of the form unable to dial nXX: breaker open, where XX is the ID of the restarted node. Note that such errors are expected for nodes that are truly unreachable, and may still occur around the time of the restart, but for no longer than a few seconds. #70311
  • RESTORE will now correctly ignore dropped databases that may have been included in cluster backups with revision history. #69791
  • Fixed a bug where if tracing was enabled (using the sql.trace.txn.enable_threshold cluster setting), the statement diagnostics collection (EXPLAIN ANALYZE (DEBUG)) would not work. #70035
  • Fixed a bug in full cluster restores where dropped descriptor revisions would cause the restore job to fail. #69654
  • Fixed a bug where schema changes that included both a column addition and primary key change in the same transaction resulted in a failed changefeed. #70022
  • Fixed a bug which prevented proper copying of partitions and zone configurations when de-interleaving a table with ALTER PRIMARY KEY when the columns did not appear in exactly the same order in the parent and child tables. #70695
  • Fixed a bug where the exit status of the cockroach command did not follow the previously-documented table of exit status codes when an error occurred during command startup. Only errors occurring after startup were reported using the correct code. This bug had existed since reference exit status codes were introduced. #70675
  • DNS unavailability during range 1 leaseholder loss will no longer cause significant latency increases for queries and other operations. #70134
  • Fixed an issue in the Pebble storage engine where a key could be dropped from an LSM snapshot if the key was deleted by a range tombstone after the snapshot was acquired. #70967
  • Fixed an internal error with joins that are both LATERAL and NATURAL/USING. #70800
  • Fixed Z and M coordinate columns causing a panic for the geometry_columns and geography_columns tables. #70813
  • Fixed a bug that could cause a CockroachDB node to deadlock upon startup in extremely rare cases. If encountered, a stack trace generated by SIGQUIT would have shown the function makeStartLine() near the top. This bug had existed since v21.1. #71408

Performance improvements

  • The conversion performance of WKT to a spatial type is slightly improved. #70181


  • Added a new as_json option which renders backup manifests as JSON values. #70298


This release includes 41 merged PRs by 24 authors.

YesYes NoNo