What's New in v20.2.6

March 15, 2021

This page lists additions and changes in v20.2.6 since v20.2.5.

Warning:

Cockroach Labs has discovered a bug relating to incremental backups, for CockroachDB v20.2.0 - v20.2.7. If a backup coincides with an in-progress index creation (backfill), RESTORE, or IMPORT, it is possible that a subsequent incremental backup will not include all of the indexed, restored or imported data.

Users are advised to upgrade to v20.2.8 or later, which includes resolutions.

For more information, including other affected versions, see Technical Advisory 63162.

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

icon/buttons/copy
$ docker pull cockroachdb/cockroach:v20.2.6

General changes

  • tar is now included in the CockroachDB Dockerfile. This allows users to use kubectl cp on 20.2.x containers. #61403

SQL language changes

  • Error messages for cross-database links now include a hint directing to the user to the deprecation docs. An example message looks like: ERROR: the view cannot refer to other databases; (see the 'sql.cross_db_views.enabled' cluster setting) SQLSTATE: 0A000 HINT: Note that cross database references will be removed in future releases. See: https://www.cockroachlabs.com/docs/releases/v21.1.0.html#deprecations #60009
  • A new parse_timestamp function can now be used to parse absolute timestamp strings in computed column expressions or partial index predicates. #60814
  • Most batches of data flowing through the vectorized execution engine will now be limited in size by sql.distsql.temp_storage.workmem (64MiB by default) which should improve the stability of CockroachDB clusters. #60571
  • The ST_Buffer spatial function now requires at least 1 quadrant segment. #61360
  • Prevented densifyFracs values of less than 1e-6 for ST_FrechetDistance and ST_HausdorffDistance spatial functions to protect panics and out of memory errors. #61434

Command-line changes

  • The cockroach command now supports the command-line parameter --version which reports its version parameters. This makes cockroach --version equivalent to cockroach version. #59753
  • The cockroach version command now supports a new parameter --build-tag. When --build-tag is specified, cockroach version displays the technical build tag, which makes it possible to integrate with automated deployment tools. #59753

DB Console changes

  • Manually enqueueing a range in the GC queue now properly respects the SkipShouldQueue option. This can be useful to force the GC of a specific range. #60745

Bug fixes

  • Re-enabled some file-level performance optimizations such as WAL preallocation and read-ahead that got inadvertently disabled in a past change. #59825
  • Previously if RELEASE SAVEPOINT cockroach_restart was followed by ROLLBACK, the sql.txn.rollback.count metric would be incremented. This was incorrect, since the transaction had already committed. That metric is no longer incremented in this case. #60250
  • Fixed a bug causing backups to fail with an error when trying to read a backup that was written. #59744
  • Fixed a bug in the optimizer statistics code that could cause an unconstrained partial index scan to be preferred over a constrained scan of the same index. #60517
  • Fixed a bug that caused errors for some queries on tables with GEOMETRY or GEOGRAPHY inverted indexes with filters containing shapes with zero area. #60599
  • 20.2 introduced the ability to rebalance replicas between multiple stores on the same node. This change fixed a problem with that feature, where occasionally an intra-node rebalance would fail and a range would get stuck, permanently under-replicated. #60633
  • Fixed an internal error caused in some cases involving JSON objects and arrays in a VALUES clause. #60808
  • Previously, retryable errors in the cleanup phase of the type schema changer wouldn't be retried automatically in the background. This is now fixed. #60817
  • Fixed a bug that could report that a protected timestamp limit was exceeded when the limit was disabled, if an error were to occur while protecting a record. #60960
  • Previously, running DROP TYPE IF EXISTS on one existent type and another non-existent type would cause an unhandled error. This is now fixed. #60951
  • Fixed a bug whereby high-latency global clusters could sometimes fall behind checkpointing resolved timestamps. #60925
  • CockroachDB previously didn't account for some RAM used when disk-spilling operations (like sorts and hash joins) were using the temporary storage in the vectorized execution engine. This could result in out-of-memory crashes, especially when the rows are large in size. #61016
  • Fixed execution errors for some queries that use set operations (UNION / EXCEPT / INTERSECT) where a column has types of different widths on the two sides (e.g. INT4 vs INT8). #61086
  • Unexpected internal errors containing stack traces that reference a countingWriter nil pointer have now been fixed. #61072
  • Made lease transfers during rebalancing adhere to the rate limit utilized in other lease transfer cases, which eliminates unexpected lease oscillations when adding a new node. #61038
  • Previously, comparing a negative integer to an OID would fail to compare correctly because the integer was not converted to an unsigned representation first. This is now fixed for both comparisons and casts. #61166
  • The SHOW CREATE output of a partitioned partial index now lists the PARTITION BY and WHERE clauses in the order accepted by the parser. The SHOW CREATE output of a partial interleaved index also now lists the INTERLEAVED and WHERE clauses in the order accepted by the parser. #61104
  • Fixed a bug causing schema changes on databases and schemas to panic in 20.2 if they failed or were cancelled and entered the reverting state. These jobs are not actually possible to revert. With this change, the correct error causing the job to fail is now returned, and the job now enters the failed state with an error indicating that the job could not be reverted. #61160
  • The SHOW TABLES FROM database command no longer shows a NULL estimated_row_count if inspecting a database that is not the current database. #61200
  • Fixed a bug in crdb_internal.unsafe_upsert_namespace_entry related to tables and types in user-defined schemas. #61260
  • Fixed a bug that prevented renaming a column that was referenced earlier in a transaction as part of a computed expression, index predicate, check expression, or not null constraint. #61257
  • Schema change jobs associated with databases and schemas can no longer be canceled. Such jobs cannot actually be reverted successfully, so cancellation had no benefit and could have caused namespace corruption. #61254
  • Fixed a bug with multi-store nodes where concurrent node startups could result in the re-use of store IDs. This could manifest in many different ways (e.g., replica thrashing due to the store ID collision). #61262
  • Fixed a bug where DROP SCHEMA ... CASCADE could result in referenced types being dropped. #61259
  • Fixed a bug whereby dropping a schema with a table that used a user-defined type which was not being dropped (because it is in a different schema) would result in a descriptor corruption due to a dangling back-reference to a dropped table on the type descriptor. #61259
  • Fixed an internal error causing EXPLAIN statements on an INSERT with an input that was determined by the optimizer to produce no rows. #61312
  • ALTER TYPE ... ADD VALUE changes are now picked up by the ARRAY type alias correctly. #61350
  • Creating interleaved partitioned indexes is now disallowed. Previously, the database would crash when trying to create one. #61422
  • A bug which caused UPSERT and INSERT ... ON CONFLICT ... DO UPDATE statements to fail on tables with both partial indexes and foreign key references has been fixed. This bug has been present since version 20.2.0. #61489
  • An UPDATE ... FROM statement where the FROM clause contained column names that matched table column names previously returned an error if the table had a partial index predicate referencing those columns. This bug, present since partial indexes were released in version 20.2.0, has been fixed. #61557
  • Fixed a bug causing an invalid tuple comparison using ANY to raise an internal error. In this case, CockroachDB now returns "unsupported comparison operator". #61658

Performance improvements

  • Enabled some file-level optimizations such as WAL preallocation and read-ahead when encryption-at-rest is used. #59825
  • Improved the optimizer's cost estimation of index scans that must visit multiple partitions. When an index has multiple partitions, the optimizer is now more likely to choose a constrained scan rather than a full index scan. This can lead to better plans and improved performance. It also improves the ability of the database to serve queries if one of the partitions is unavailable. #61069

Contributors

This release includes 52 merged PRs by 25 authors.

YesYes NoNo