What's New in v21.1.0-alpha.3

February 8, 2021

Get future release notes emailed to you:

Downloads

Docker image

icon/buttons/copy
$ docker pull cockroachdb/cockroach-unstable:v21.1.0-alpha.3

General changes

  • Added ability to further debug connections shut down automatically by the server. #59460

SQL language changes

  • Fixed up ALTER TABLE ... ADD CONSTRAINT ... UNIQUE to partition correctly under a PARTITION ALL BY table. #59364
  • CockroachDB now applies zone configs to new unique constraints in REGIONAL BY ROW tables. #59364
  • A new, unused field called global_reads was added to zone configurations. The field does not yet have any effect. #59304
  • A new private cluster setting sql.distsql.temp_storage.hash_agg.enabled was added that allows users to disable the disk spilling capability of the hash aggregation in the vectorized execution engine. It is true by default which incurs some performance hit. Setting it to false will improve the performance, but the queries might hit an out-of-memory limit error. #59414
  • The optimizer now enforces a unique constraint on the explicit index columns for implicitly partitioned unique indexes and unique indexes in REGIONAL BY ROW tables. An attempt to insert or update a row such that the unique constraint is violated will result in an error. #59501
  • REGIONAL BY ROW tables now preserve zone configurations when using ALTER PRIMARY KEY. #59365
  • Implemented ALTER TABLE ... LOCALITY REGIONAL BY TABLE from LOCALITY GLOBAL. #59407
  • Zone configs now support new attributes num_voters and voter_constraints. num_voters will specify the number of voting replicas. When num_voters is explicitly specified, num_replicas will be the sum of voting and non-voting replicas. voter_constraints will specify the constraints that govern the placement of just the voting replicas, whereas the existing constraints attributes will govern the placement of all replicas (voting as well as non-voting). #57184
  • Added SQL syntax for RESTORE tenant x FROM REPLICATION STREAM FROM 'replication_stream'. This allows the user to start an ingestion job to ingest KVs from the replication stream into the destination tenant's keyspace. #59112
  • The SHOW CREATE statement now lists ALTER PARTITION statements sorted by the partition name and index_name. #59580
  • 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 #59551
  • The escape_string_warning session variable from PostgreSQL was added with compatibility-only support. It defaults to on and cannot be changed. #59479
  • Multi-column inverted indexes can now be created. The last indexed column must be inverted types such as JSON, ARRAY, GEOMETRY, and GEOGRAPHY. All preceding columns must have types that are indexable. These indexes may be used for queries that constrain all index columns. #59565
  • Added WITH full_table_name option to create a changefeed on movr.public.drivers instead of drivers. #59258
  • UPSERTs on tables with an implicitly partitioned primary index now use only the explicit primary key columns as the conflict columns, excluding all implicit partitioning columns. This also applies to REGIONAL BY ROW tables, ensuring that the crdb_region column is not included in the UPSERT key. #59654

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. #58665
  • The cockroach version command now supports a new parameter --build-tag; when specified, it displays the technical build tag, which makes it possible to integrate with automated deployment tools. #58665
  • The channels parameter for the log sink configurations now supports a more flexible input configuration format:
    Syntax to include specific channels:
    channels: dev,sessions (yaml string)
    channels: 'dev,sessions' (yaml string, equivalent to previous)
    channels: [dev,sessions] (yaml array, can use multi-line syntax with hyphens too)
    channels: ['dev','sessions'] (same as previous)
    channels: '[dev,sessions]' (bracket-enclosed list inside yaml string)

    Syntax to include all channels:
    channels: all (yaml string)
    channels: 'all' (same as previous)
    channels: [all] (yaml array)
    channels: ['all'] (same as previous)
    channels: '[all]' (bracket-enclosed "all" inside yaml string)

    Syntax to include all channels except some:
    channels: all except dev,sessions (yaml string)
    channels: 'all except dev,sessions' (same as previous, quoted string)
    channels: 'all except [dev,sessions]' (same as previous, list is bracket enclosed)

    For example: sinks: stderr: channels: - DEV - SQL_SESSIONS uses the "native" YAML syntax for lists. #59352

  • The notification that SIGHUP was received, and that log files are flushed to disk as a result, is now sent to the OPS logging channel. #59345

  • The notification that SIGHUP was received, and that TLS certificates are reloaded from disk as a result, is now sent to the OPS logging channel as a structured event. Refer to the reference docs for details about the event payload. #59345

API endpoint changes

  • Added a new API tree, in /api/v2/*, currently undocumented, that avoids the use of cookie-based authentication in favor of sessions in headers, and support for pagination. #58436

DB Console changes

  • Updated the table details page to show table-specific zone configuration values when set, show constraints and lease preferences, and display a valid statement to re-configure zone configuration for that table. #59196
  • Users can now see the time series of full table or index scans in the Advanced Debug page. #59261
  • The sql.leases.active gauge is now available to track the outstanding descriptor leases in the cluster. #57561
  • Long queries are truncated in the DB Console. #59603

Bug fixes

  • Added event logs for SET SCHEMA statements. #58737
  • Fixed an issue where a left inverted join could have incorrect results. In particular, some output rows could have non-NULL values for right-side columns when the right-side columns should have been NULL. This issue has only existed in alpha releases of 21.1 so far, and it is now fixed. #59279
  • Fixed a panic where type hints mismatching placeholder names cause a crash. #59450
  • Unexpected internal errors containing stack traces that reference a countingWriter null pointer have now been fixed. #59477
  • Fixed a bug introduced in v20.1 in the DB Console where incorrect zone configuration values were shown on the table details page and constraints and lease preferences were not displayed. #59196
  • Changefeeds no longer error with "1e2 is not roundtrippable at scale 2" when 100 is stored in a column with width 2. #59075
  • Fixed a bug which 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. #59384
  • Added event logs for privilege changes in crdb_internal.unsafe_xxx. #59282
  • Fixed a bug in which incorrect results could be returned for left and anti joins. This could happen when one of the columns on one side of the join was constrained to multiple constant values, either due to a check constraint or an IN clause. The bug resulted in non-matching input rows getting returned multiple times in the output, which is incorrect. This bug only affected previous alpha releases of 21.1, and has now been fixed. #59646
  • Fixed EXPLAIN ANALYZE (DEBUG) interaction with the SQL shell. #59557
  • Fixed a bug preventing foreign key constraints referencing hidden columns (e.g., rowid) from being added. #59659
  • Fixed a bug where DROP SCHEMA ... CASCADE could result in types which are referenced being dropped. #59281
  • 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. #59281

Performance improvements

  • The query optimizer now plans scans over inverted indexes on JSON columns for query filters that constrain the JSON column with equality and fetch value operators (->) inside conjunctions and disjunctions, like j->'a' = '1' AND j->'b' = '2'. #59266
  • Fixed a bug included in 20.2.1 for the JSON fetch value operator, -> which resulted in chained -> operators in query filters not being index accelerated (e.g., j->'a'->'b' = '1'). Chained -> operators are now index accelerated. #59494
  • Improved the allocation performance of workloads that use the EXTRACT builtin. #59598

Contributors

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

  • John Seekins (first-time contributor)
  • Ulf Adams (first-time contributor)
YesYes NoNo