Het team achter CockroachDB heeft twee nieuwe versies uitgebracht met 23.1.11 en 22.2.14 als de versienummers. Dit is een opensourcedatabase die uitermate geschikt is voor cloudomgevingen en die verschillende opties voor het opvangen van problemen in de bijbehorende verspreide data biedt. Voor meer informatie verwijzen we naar deze pagina, waar de meestgestelde vragen worden beantwoord. De lijst met aanpassingen van deze uitgaves ziet er als volgt uit:
What's New in v23.1.11
Note: v23.1.11 is currently available only on select CockroachDB Dedicated clusters. If you wish to upgrade your Dedicated cluster to v23.1.11, please submit a support request. This release is currently not available for CockroachDB Serverless or Self-Hosted customers.
SQL language changesOperational changes
- Added a new syntax to SHOW DEFAULT PRIVILEGES, SHOW DEFAULT PRIVILEGES FOR GRANTEE that shows the default privileges that a grantee received. #108285
- The admin API database details endpoint now returns authoritative range statistics. #108727
- Added the cluster setting sql.stats.limit_table_size.enabled, which controls whether or not CockroachDB enforces the row limit set by sql.stats.persited_rows.max in the system.statement_statistics and system.transaction_statistics tables. #108912 Optimized the sql-stats-compaction job's delete query to avoid a full scan. This helps avoid a transaction retry error, which can cause the job to fail. #108987
- Fixed an issue where the UI was missing query text and details when looking at the SQL activity transactions page if there were more than 500 transactions or statements. The crdb_internal.statement_activity table now includes all statements for a transaction that are in the crdb_internal.transaction_activity table. #109479
- Added the VIEWSYSTEMTABLE system privilege. Users with this privilege have SELECT privileges for all tables in the system database. #109525
- The oidvectortypes built-in function has been implemented, which can format an oidvector. #109711
- The internal persisted statistics table max size check is now done once an hour instead of every 10 minutes. This reduces the risk of serialization errors on the statistics tables. #109707
- Introspection queries will now show the internal node user as the owner of tables in pg_catalog and information_schema. Previously, the owner was shown as admin, but that was inaccurate since users with the admin role could not modify these tables in any way. #109735
Command-line changes
- Added the kv.enqueue_in_replicate_queue_on_span_config_update.enabled cluster setting. When set to true, stores in the cluster will enqueue replicas for replication changes upon receiving config updates that could affect the replica. This setting is off by default. Enabling this setting speeds up how quickly config-triggered replication changes begin, but adds additional CPU overhead. The overhead scales with the number of leaseholders. #108812
- Added a new cluster setting named server.hot_ranges_request.node.timeout, with a default value of 5 minutes. The setting controls the maximum amount of time that a hot ranges request will spend waiting for a node to provide a response. Set it to 0 to disable timeouts. #109015
- Span stats requests will return a partial result if the request encounters any errors. Errors that would have previously terminated the request are now included in the response. #109008
- BACKUP now skips contacting the ranges for tables on which exclude_data_from_backup is set, and can thus succeed even if an excluded table is unavailable. #109123
- The RPC dial and heartbeat timeouts can now be configured via the environment variables COCKROACH_RPC_DIAL_TIMEOUT (default 2x COCKROACH_NETWORK_TIMEOUT or 2x2=4 seconds) and COCKROACH_RPC_HEARTBEAT_TIMEOUT (default 3x COCKROACH_NETWORK_TIMEOUT or 3x2=6 seconds). This allows configuring these values independently of COCKROACH_NETWORK_TIMEOUT. #109358
- The default gRPC server-side send timeout has been increased from 2 seconds to 4 seconds (1x to 2x of COCKROACH_NETWORK_TIMEOUT), to avoid spurious connection failures in certain scenarios. This can be controlled via the new environment variable COCKROACH_RPC_SERVER_TIMEOUT. #109620
- Added a new gauge metric sql.schema.invalid_objects. This gauge is periodically updated based on the schedule set by the sql.schema.telemetry.recurrence cluster setting. When the metric is updated, it counts the number of schema objects (tables, types, schemas, databases, and functions) that are in an invalid state according to CockroachDB's internal validation checks. This metric is expected to be zero (0) in a healthy cluster. If it is not zero, it indicates that there is a problem that must be repaired. #109733
- Added two new changefeed metrics: changefeed.checkpoint_progress is similar to changefeed.max_behind_nanos, but it also supports metrics labels. changefeed.aggregator_progress tracks the progress of individual aggregators (the lowest timestamp for which all aggregators with the label have emitted all values they're responsible for). #109744
DB Console changes
- Removed the command \demo recommission from cockroach demo. It had been obsolete and non-functional since v20.2. #108631
Bug fixes
- Users without the VIEWCLUSTERSETTINGS permission, but with the VIEWACTIVITY or VIEWACTIVITYREDACTED permissions, can now see index recommendations. #109466
- CockroachDB will now show a warning when the time period selected on the SQL Activity page is older than the oldest data available. #109468
Performance improvements
- Fixed a buggy TTL descriptor repair by removing it. Previously, upgrading from v22.2.x to 23.1.9 incorrectly removed TTL storage params from tables (visible via SHOW CREATE TABLE ) while attempting to repair table descriptors. This resulted in the node that attempts to run the TTL job crashing due to a panic caused by the missing TTL storage parameters. Clusters currently on v22.2.x should not be upgraded to v23.1.9 and should be upgraded directly to v23.1.10 or later. For more information, see Technical Advisory 110363. #110562
- Users with the VIEWACTIVITY privilege should be able to see other users' sessions from both the CLI and the DB Console. #108571
- Fixed errors on the Sessions page in the DB Console when a session's memory usage is zero bytes. #108619
- Fixed a bug in cockroach demo whereby \demo add could sometimes crash with an error "index out of range [...] with length ...". This bug was introduced in v19.x. #108631
- Fixed a bug whereby the command \demo decommission in cockroach demo could sometime leave the demo cluster in a broken state. This bug was introduced in v20.2. #108631
- Fixed a bug in the index recommendations provided in the EXPLAIN output where ALTER INDEX ... VISIBLE index recommendations may suggest making the wrong index visible when there are multiple invisible indexes in a table. #108646
- Fixed a bug that could cause a query with LIMIT and ORDER BY to return results in the wrong order. This bug could cause incorrect results as well if the LIMIT was nested within an outer query, e.g. under another LIMIT. This bug had existed since before v22.2. #106798
- Fixed a bug with collated string type checking with nested case expressions where an inner case had no explicit collated type. #108345
- Fixed a bug where RELEASE SAVEPOINT could incorrectly emit the message "cannot publish new versions for descriptors" instead of a retryable error to applications. #108478
- Fixed a bug that could cause CPU usage to increase over time. #108801
- Fixed a bug introduced in v22.1 that could cause a join to infinite-loop in rare cases when (1) the join filter is not an equality and (2) no columns from the left input are returned. #106875
- Users with the VIEWACTIVITY permission can now view correct values for the current timezone in the DB Console. #108780
- Fixed a bug present since v23.1.0 that would cause queries on the pg_catalog.pg_statistic_ext table to fail if a table was dropped recently. This bug also caused the \d CLI shortcut to encounter errors. #108909
- Fixed a bug where pg_attribute and pg_attrdef did not properly return results for generated columns. #109035
- The Schema Insights view should hit request timeouts less frequently, if at all. #109014
- Fixed a bug that caused nodes to crash when attempting to EXECUTE a prepared statement with an argument that referenced a user-defined function. This bug was present since user-defined functions were introduced in v22.2. #108469
- Fixed a bug so the filter on the Statements Page works when the app name is an empty string (represented as 'unset'). #108985
- Fixed a bug where a SpanStatsRequest would return post-replicated MVCC stats, which was causing incorrect output in SHOW RANGES ... WITH DETAILS. Now, a SpanStatsRequest returns the logical MVCC stats for the requested span. #109234
- Fixed an issue with the "full scan" filter in the UI, where the filter was not returning any results. #109274
- Going to the Transaction Details Page from Workload Insights > High Contention is fixed. Previously, the link would not show any results. #109253
- Fixed the column names on the SELECT queries against the tables crdb_internal.node_txn_execution_insights and crdb_internal.cluster_txn_execution_insights during the creation of debug.zip files. #109515
- Fixed a bug that could cause some rows to be silently skipped during IMPORT when a node failed. #109663
- Fixed a bug in geospatial queries where more rows could be returned by the query than expected. This could happen when a query filter of the form ST_Distance(geog1, geog2) > constant or ST_MaxDistance(geom1, geom2) > constant, where the operator was one of >, <, >=, <=, or a filter of the form ST_Distance(geog1, geog2, false) = 0 would sometimes mistakenly evaluate to true when one or both of the inputs was NULL or an empty geography or geometry. #109393
- Fixed an issue where a split can be called on an invalid key that's in the form of someValidKey.Next() during restore. This split key can land in the middle of a row with column families, and thus result in failing SQL queries when querying the restored table. #109777
- Fixed an issue where a split can be called on an invalid key that's in the form of someValidKey.Next() during restore with the bulkio.restore.use_simple_import_spans cluster setting set to true. This split key can land in the middle of a row with column families, and thus result in failing SQL queries when querying the restored table. #109940
- The difference built-in function had its return type incorrectly set to string instead of integer. #109752
- Fixed a bug where dependencies on sequences from tables would be reported with the wrong value for the classid column in the pg_catalog.pg_depend table. #110206
- Fixed a bug that could cause a transaction performing multiple parallel foreign key checks to return a concurrent txn use detected error. #110273
- Various observability pages in the DB Console no longer crash when they encounter zeros (e.g., a session with no memory allocated). #108785
What's New in v22.2.14
- Improved the cost of resolving a user-defined enum type that has many values. #109470
- Queries that access the pg_catalog and information_schema that perform introspection on other tables in those schemas are now significantly faster. #109735
SQL language changesGeneral changes
- Added a new syntax to SHOW DEFAULT PRIVILEGES. Executing SHOW DEFAULT PRIVILEGES FOR GRANTEE shows the default privileges that a grantee received. #108283
Operational changes
- CockroachDB binaries and Docker images for Linux on the ARM architecture are generally available.
Bug fixes
- Nodes are now considered suspect when rejoining a cluster and cannot accept lease transfers for one server.time_after_store_suspect window, which defaults to 30 seconds. #107670
- Added two new changefeed metrics: changefeed.checkpoint_progress is similar to changefeed.max_behind_nanos but supports metrics labels; changefeed.aggregator_progress tracks the progress of individual aggregators (the lowest timestamp for which all aggregators with the label have emitted all values they're responsible for). #109745
- Fixed a potential deadlock when running changefeeds with end_time option set. #108076
- Added cancel checking to index constraint initialization code to allow queries to timeout during query optimization if analyzing predicates to constrain an index starts using too many resources. Example of setting a timeout using the statement_timeout session setting: SET statement_timeout='5.0s';. #106950
- Fixed the schema changer job when CREATE AS sources from SHOW CREATE FUNCTION, for example: CREATE TABLE t AS SELECT * FROM [SHOW CREATE FUNCTION f];. #108167
- Previously, CockroachDB could encounter an internal error unexpected non-zero bytes limit for txnKVStreamer when evaluating locality-optimized lookup joins in case it had to perform the remote regions' lookup. The bug was introduced in v22.2 and is now fixed. A temporary workaround can be accomplished without upgrading by setting the streamer_enabled session variable: SET streamer_enabled = false;. #108252
- Fixed a spurious error no data source matches prefix that could occur during planning for a query with DISTINCT ON and ORDER BY ASC NULLS LAST or ORDER BY DESC NULLS FIRST. #108302
- Fixed a bug where using IMPORT INTO for DELIMITED DATA or MySQL imports would error with column ... does not exist if it was importing into a collated string column. #108287
- Fixed a bug in the index recommendations provided in the EXPLAIN output where ALTER INDEX ... VISIBLE index recommendations may suggest making the wrong index visible when there are multiple invisible indexes in a table. #108647
- Fixed a bug that could cause a query with LIMIT and ORDER BY to return results in the wrong order. This bug could also cause incorrect results if the LIMIT was nested within an outer query, for example, under another LIMIT. #107379
- Fixed a bug introduced in v22.1 that could cause a join to infinite-loop in rare cases when the join filter is not an equality and no columns from the left input are returned. #106874
- Fixed a bug that caused nodes to crash when attempting to EXECUTE a prepared statement with an argument that referenced a user-defined function (UDF). This bug was present since user-defined functions were introduced in v22.2.0. #108473
- Fixed an issue with the full scan filter on the Statements page where the filter was always evaluating to false, even if a full scan had occurred. #109284
- Fixed a bug that could cause some rows to be silently skipped during IMPORT when a node's import worker failed. #109662
- Fixed a bug where calls to user-defined functions (UDFs) with NULL arguments returned ambiguous results. #109193
- Fixed a very rare condition where the storage engine stops making progress, reporting background error: pebble: flush next log number is unset in the cockroach-pebble.log. #109862
- Fixed a nil pointer dereference panic during node startup caused by an incorrect initialization order. #109685
- Fixed an issue where a split can be called on an invalid key that's in the form of someValidKey.Next() during restore with the cluster setting bulkio.restore.use_simple_import_spans=true. This split key can land in the middle of a row with column families, and thus result in failing SQL queries when querying the restored table. #109941