What's New in v21.1.4

June 29, 2021


We recommend upgrading from this release to the v21.1.5 bugfix release as soon as possible.

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.4

Security updates

  • Previously, all the logging output to files or network sinks was disabled temporarily while an operator was using the /debug/logspy HTTP API, resulting in lost entries and a breach of auditability guarantees. This behavior has been corrected. #66328
  • CockroachDB now configures a maximum number of concurrent password verifications in the server process, across UI and SQL clients. This limit reduces the risk of DoS attacks or accidents due to misbehaving clients. By default, the maximum amount of concurrency is ~12% of the number of allocated CPU cores (as per GOMAXPROCS), with a minimum of 1 core. This default can be overridden using the environment variable COCKROACH_MAX_BCRYPT_CONCURRENCY. #66367

SQL language changes

Command-line changes

  • The SQL shell now formats times with time zones so that the minutes and seconds offsets are only shown if they are non-zero. Also, infinite floating point values are now formatted as Infinity rather than Inf. #66130
  • When log entries are written to disk, the first few header lines written at the start of every new file now report the configured logging format. #66328

API endpoint changes

  • The /debug/logspy HTTP API has changed. The endpoint now returns JSON data by default. If the previous format is desired, the user can pass the query argument &flatten=1 to the logspy URL to obtain the previous flat text format (crdb-v1) instead. #66328 This change is motivated as follows:
    • The previous format, crdb-v1, cannot be parsed reliably.
    • Using JSON entries guarantees that the text of each entry all fits on a single line of output (newline characters inside the messages are escaped). This makes filtering easier and more reliable.
    • Using JSON enables the user to apply jq on the output, for example via curl -s .../debug/logspy | jq ....
  • The /debug/logspy API no longer enables maximum logging verbosity automatically. To change the verbosity, use the new /debug/vmodule endpoint or pass the &vmodule= query parameter to the /debug/logspy endpoint. #66328 For example, suppose you wish to run a 20s logspy session:
    • Before: curl 'https://.../debug/logspy?duration=20s&...'.
    • Now: curl 'https://.../debug/logspy?duration=20s&vmodule=...' OR curl 'https://.../debug/vmodule?duration=22s&vmodule=...' curl 'https://.../debug/logspy?duration=20s'.
    • As for the regular vmodule command-line flag, the maximum verbosity across all the source code can be selected with the pattern *=4.
    • Note: at most one in-flight HTTP API request is allowed to modify the vmodule parameter. This maintains the invariant that the configuration restored at the end of each request is the same as when the request started.
  • The new /debug/vmodule API makes it possible for an operator to configure the logging verbosity in a similar way as the SQL builtin function crdb_internal.set_vmodule(), or to query the current configuration as in crdb_internal.get_vmodule(). Additionally, any configuration change performed via this API can be automatically reverted after a configurable delay. #66328 The API forms are:
    • /debug/vmodule: Retrieve the current configuration
    • /debug/vmodule?set=[vmodule config]&duration=[duration]: Change the configuration to [vmodule config] . The previous configuration at the time the /debug/vmodule request started is restored after [duration]. This duration, if not specified, defaults to twice the default duration of a logspy request (currently, the logspy default duration is 5s, so the vmodule default duration is 10s). If the duration is zero or negative, the previous configuration is never restored.

DB Console changes

  • Fixed an issue with displaying more than 100 hours of remaining time on the Jobs page. #66596

Bug fixes

  • Minute timezone offsets are only displayed in the wire protocol if they are non-zero for TimestampTZ and TimeTZ values. Previously, they would always display. #66130
  • Fixed a bug where binary TimeTZ values were not being decoded correctly when being sent as a parameter in the wire protocol. #66130
  • CockroachDB's SQL shell now properly displays results of common array types, for example: arrays of floats, or arrays of strings. #66130
  • Fixed a bug where the --log='file-defaults: {format: crdb-v1}' flag was not being handled properly. This bug existed since v21.1.0. #66328
  • Fixed a bug where log entries could be lost while the /debug/logspy HTTP API was being used. This bug had existed since CockroachDB v1.1. #66328
  • The binary encoding of decimals will no longer have negative dscale values. This was preventing Npgsql from being able to read some binary decimals from CockroachDB. #66532
  • A bug has been fixed which prevented the optimizer from producing plans with partial indexes when executing some prepared statements that contained placeholders, stable functions, or casts. This bug was present since partial indexes were added in v20.2.0. #66634
  • Fixed a bug which could have prevented backups from being successfully restored. #66616
  • Fixed a bug where CockroachDB could crash when executing EXPLAIN (VEC) on some mutations. The bug is present only in the v21.1.1-v21.1.3 releases. #66573
  • Fixed a bug where CockroachDB could encounter an internal error when computing window functions with ROWS mode of window framing if the offsets were very large for the OFFSET FOLLOWING boundary type. #66446
  • Fixed a bug where using ADD COLUMN UNIQUE on REGIONAL BY ROW tables did not correctly add the zone configs for the newly created column index. #66696
  • Fixed a bug where reading from Google Cloud Storage was not using the resuming reader, as a result of which some retryable errors were not being treated as such, and the read would fail. #66190
  • Fixed a deadlock during backups and imports. #66773
  • Fixed incorrect accounting for statement/transaction sampled execution statistics. #66790
  • Fixed a bug causing transactions to be spuriously aborted in rare circumstances. #66567

DB Console

  • Fixed a CSS width calculation which was causing the multibar to not be visible in the DB Console. #66739


This release includes 28 merged PRs by 22 authors.

YesYes NoNo