Release Notes for v2.0-alpha.20180116

January 16, 2018

Backwards-Incompatible Changes

  • Removed the obsolete kv.gc.batch_size cluster setting. #21070
  • Removed the COCKROACH_METRICS_SAMPLE_INTERVAL environment variable. Users that relied on it should reduce the value for the timeseries.resolution_10s.storage_duration cluster setting instead. #20810

General Changes

  • CockroachDB now proactively rebalances data when the diversity of the localities that a given range is located on can be improved. #19489
  • Clusters are now initialized with default .meta and .liveness replication zones with lower GC TTL configurations. #17628

SQL Language Changes

  • The new SHOW CREATE SEQUENCE statement shows the CREATE SEQUENCE statement that would create a carbon copy of the specified sequence. #21208
  • The DROP COLUMN statement now drops CHECK constraints. #21203
  • The pg_sequence_parameters() built-in function is now supported. #21069
  • ON DELETE CASCADE foreign key constraints are now fully supported and memory bounded. #20064 #20706
  • For improved troubleshooting, more complete and useful details are now reported to clients when SQL errors are encountered. #19793
  • The new SHOW SYNTAX statement allows clients to analyze arbitrary SQL syntax server-side and retrieve either the (pretty-printed) syntax decomposition of the string or the details of the syntax error, if any. This statement is intended for use in the CockroachDB interactive SQL shell. #19793
  • Enhanced type checking of subqueries in order to generalize subquery support. As a side-effect, fixed a crash with subquery edge cases such as SELECT (SELECT (1, 2)) IN (SELECT (1, 2)). #21076
  • Single-use common table expressions are now supported. #20359
  • Statement sources with no output columns are now disallowed. #20998
  • WHERE predicates that simplify to NULL no longer performs table scans. #21067
  • The experimental CREATE ROLE, DROP ROLE, and SHOW ROLES statements are now supported. #21020 #20980
  • Improved the output of EXPLAIN to show the plan tree structure. #20697
  • OUTER interleaved joins are now supported. #20963
  • Added the rolreplication and rolbypassrls columns to the pg_catalog.pg_roles table. #20397
  • ARRAY values can now be cast to their own type. #19816
  • The || operator is now supported for JSONB. #20689
  • The CASCADE option is now required to drop an index that is used by Unique constraint. #20837
  • The BOOL type now matches PostgreSQL's list of accepted formats. #20833
  • The sql_safe_updates session variable now defaults to false unless the shell is truly interactive (using cockroach sql, -e not specified, standard input not redirected) and --unsafe-updates is not specified. Previously, sql_safe_updates would always default to true unless --unsafe-updates was specified. #20805
  • The errexit client-side option now defaults to false only if the shell is truly interactive, not only when the input is not redirected as previously. #20805
  • The display_format client-side option now defaults to pretty in every case where the output goes to a terminal, not only when the input is not redirected as previously. #20805
  • The check_syntax and smart_prompt client-side options, together with the interactive line editor, are only enabled if the session is interactive and output goes to a terminal. #20805
  • Table aliases are now permitted in RETURNING clauses. #20808
  • Added the SERIAL2, SERIAL4, and SERIAL8 aliases for the SERIAL type. #20776
  • NULL values are now supported in COLLATE expressions. #20795
  • The new crdb_internal.node_executable_version() built-in function simplifies rolling upgrades. #20292
  • The json_pretty(), json_extract_path(), jsonb_extract_path(), json_object(), and asJSON() built-in function are now supported. #20702 #20520 #21015 #20234
  • The DISTINCT ON clause is now supported for SELECT statements. #20463
  • For compatibility with PostgreSQL and related tools:
    • Parsing of the COMMENT ON syntax is now allowed. #21063
    • The following built-in functions are now supported: pg_catalog.pg_trigger(), pg_catalog.pg_rewrite(), pg_catalog.pg_operator(), pg_catalog.pg_user_mapping(), pg_catalog.foreign_data_wrapper(), pg_get_constraintdef(), inet_client_addr(), inet_client_port(), inet_server_addr(), inet_server_port(). #21065 #20788
    • Missing columns have been added to information_schema.columns, and the pg_catalog.pg_user() virtual table has been added. #20788
    • A string cast to regclass is interpreted as a possibly qualified name like #20788
    • Rendered columns for built-in functions are now titled by the name of the built-in function. #20820

Command-Line Changes

  • Client cockroach commands that use SQL (cockroach sql, cockroach node ls, etc.) now print a warning if the server is running an older version of CockroachDB than the client. Also, this and other warning messages are now clearly indicated with the "warning:" prefix. #20935
  • Client-side syntax checking performed by cockroach sql when the check_syntax option is enabled has been enhanced for forward-compatibility with later CockroachDB versions. #21119
  • The \? client-side command of cockroach sql now prints out a description of each option. #21119
  • The --unsafe-updates of cockroach sql was renamed to --safe-updates. The default behavior is unchanged: The previous flag defaulted to false; the new flag defaults to true. #20935
  • The cockroach sql command no longer fails when the server is running a version of CockroachDB that does not support the sql_safe_updates session variable. #20935

Admin UI Changes

  • Added graphs of node liveness heartbeat latency, an important internal signal of health, to the Distributed dashboard. #21002
  • Capacity Used is now shown as "-" instead of 100% when the UI can't load the real data from the server. #20824
  • Removed a redundant rendering of the GC pause time from the CPU Time graph. #20802
  • The Databases page now reports table sizes that are better approximations to actual disk space usage. #20627
  • Added a system table to allow operators to designate geographic coordinates for any locality. This is for use with upcoming cluster visualization functionality in the Admin UI. #19652

Bug Fixes

  • Fixed the debug compact command to compact all sstables. #21293
  • Fixed tuple equality to evaluate correctly in the presence of NULL elements. #21230
  • Fixed a bug where the temporary directory was being wiped on failed CockroachDB restart, causing importing and DistSQL queries to fail. #20854
  • The "JSON" column in the output of EXPLAIN(DISTSQL) is now properly hidden by default. It can be shown using SELECT *, JSON FROM [EXPLAIN(DISTSQL) ...]. #21154
  • EXPLAIN queries with placeholders no longer panic. #21168
  • The --safe-updates flag of cockroach sql can now be used effectively in non-interactive sessions. #20935
  • Fixed a bug where non-matching interleaved rows were being inner-joined with their parent rows. #20938
  • Fixed an issue where seemingly irrelevant error messages were being returned for certain INSERT statements. #20841
  • Crash details are now properly copied to the log file even when a node was started with --logtostderr as well as in other circumstances when crash details could be lost previously. #20839
  • It is no longer possible to log in as a non-existent user in insecure mode. #20800
  • The BIGINT type alias is now correctly shown when using SHOW CREATE TABLE. #20798
  • Fixed a scenario where a range that is too big to snapshot can lose availability even with a majority of nodes alive. #20589
  • Fixed BETWEEN SYMMETRIC, which was incorrectly considered an alias for BETWEEN. Per the SQL99 specification, BETWEEN SYMMETRIC is like BETWEEN, except that its arguments are automatically swapped if they would specify an empty range. #20747
  • Fixed a replica corruption that could occur if a process crashed in the middle of a range split. #20704
  • Fixed an issue with the formatting of unicode values in string arrays. #20657
  • Fixed detection and proper handling of certain variations of network partitions using server-side RPC keepalive in addition to client-side RPC keepalive. #20707
  • Prevented RPC connections between nodes with incompatible versions. #20587
  • Dangling intents are now eagerly cleaned up when AmbiguousResultErrors are seen. #20628
  • Fixed the return type signature of the JSON #>> operator and array_positions() built-in function. #20524
  • Fixed an issue where escaped characters like \A and \\ in LIKE/ILIKE patterns were not handled properly. #20600
  • Fixed an issue with (NOT) (I)LIKE pattern matching on _...% and %..._ returning incorrect results. #20600
  • Fixed a small spelling bug that made it such that a DOUBLE PRECISION specified type would erroneously display as a float. #20727
  • Fixed a crash caused by null collated strings. #20637

Performance Improvements

  • Improved the efficiency of scans with joins and certain complex WHERE clauses containing tuple equality. #21288
  • Improved the efficiency scans for certain WHERE clauses. #21217
  • Reduced per-row overhead in distsql query execution. #21251
  • Added support for distributed execution of UNION queries. #21175
  • Improved performance for aggregation and distinct operations by arena allocating "bucket" storage. #21160
  • Distributed execution of UNION ALL queries is now supported. #20742
  • Reduced the fixed overhead of commands sent through Raft by 40% by only sending lease sequence numbers instead of sending the entire lease structure. #20953
  • When tables are dropped, the space is now reclaimed in a more timely fashion. #20607
  • Increased speed of except and merge joins by avoiding an unnecessary allocation. #20759
  • Improved rebalancing to make thrashing back and forth between nodes much less likely, including when localities have very different numbers of nodes. #20709
  • Improved performance of DISTINCT queries by avoiding an unnecessary allocation. #20755 #20750
  • Significantly improved the efficiency of DROP TABLE and TRUNCATE. #20601
  • Improved performance of low-level row manipulation routines. #20688
  • Raft followers now write to their disks in parallel with the leader. #19229
  • Significantly reduced the overhead of SQL memory accounting. #20590
  • Equality joins on the entire interleave prefix between parent and (not necessarily direct) child interleaved tables are now faster. #19853

Doc Updates