Het team achter CockroachDB heeft een aantal nieuwe versies uitgebracht met 20.1.0, 19.2.7 en 19.1.9 als de versienummers. Dit is een opensourcedatabase die uitermate geschikt is voor cloudomgevingen en die verschillende opties voor het opvangen van problemen biedt, dankzij de verspreide opzet. Voor meer informatie verwijzen we naar deze pagina, waar de meest gestelde vragen worden beantwoord. Wie wellicht verbaasd opkijkt van het versienummer, kan in deze blog de achtergrondinformatie terugvinden over deze verandering. De beknopte aankondigingen van deze uitgaves zien er als volgt uit:
What's New in v20.1.0
With the release of CockroachDB v20.1, we've made a variety of productivity, performance, and security improvements. Check out a comprehensive summary of the most significant user-facing changes and then upgrade to CockroachDB v20.1. You can also read more about these changes in the v20.1 blog post or watch our 20.1 release demo and overview.
What's New in v19.2.7
Backward-incompatible changesGeneral changes
- Prior to this patch, the phase of server shutdown responsible for range lease transfers to other nodes would give up after 10000 attempts of transferring replica leases away, regardless of the value of server.shutdown.lease_transfer_wait. The limit of 10,000 attempts has been removed, so that now only the maximum duration server.shutdown.lease_transfer_wait applies. #47691
- The textual error and warning messages displayed by cockroach quit under various circumstances have been updated. The message ok still indicates that the operation has likely succeeded. #47691
- cockroach quit now prints out progress details on its standard error stream, even when --logtostderr is not specified. Previously, nothing was printed on standard error. Scripts that wish to ignore this output can redirect the standard error stream. #47691
- The copy of system and crdb_internal tables extracted by cockroach debug zip is now written using the TSV format (inside the ZIP file), instead of an ASCII-art table as previously. #48098
SQL language changes
- Prior to this patch, the phase of server shutdown responsible for range lease transfers to other nodes had a hard timeout of 5 seconds. This timeout is now configurable with the new cluster setting server.shutdown.lease_transfer_wait. #47691
Command-line changes
- Columns in the process of being added or removed to a table are now always set to their default or computed value if another transaction concurrently inserts, updates, or upserts a row. This fixes an issue where a column being backfilled would not be properly set by concurrent transactions. #47411
- The pg_collation, pg_proc, and pg_type tables in pg_catalog no longer require privileges on any database in order for the data to be visible. #48081
- Histogram collection with CREATE STATISTICS is no longer supported on columns with type ARRAY. Only row count, distinct count, and null count are collected for ARRAY-type columns. #48344
- CockroachDB now correctly reports the type length for the CHAR data type. #48643
Bug fixes
- The time that cockroach quit waits client-side for the node to drain (i.e., remove existing clients and push range leases away) is now configurable with the flag --drain-wait. The default value for --drain-wait is 10 minutes. Note that separate server-side timeouts still apply. Check the server.shutdown.* cluster settings for details. #47691
- It is now possible to drain a node without shutting down the process, using cockroach node drain. This makes it easier to integrate CockroachDB with service managers and orchestration. It is safe to issue cockroach node drain and then separately stop the service via a process manager or orchestrator. Without this new command, there is a risk of misconfiguring the service manager to auto-restart the node after it shuts down via cockroach quit. cockroach node drain also recognizes the new --drain-wait flag. #47691
- The commands cockroach quit and cockroach node drain now report a "work remaining" metric on their standard error stream. The value reduces until it reaches 0 to indicate that the graceful shutdown has completed server-side. #47691
- To support clusters that have been configured to use a cluster name, client commands such as cockroach init and cockroach quit now support the --cluster-name and --disable-cluster-name-verification flags. Previously it was impossible to run such commands against nodes configured with the --cluster-name flag. #48017
- cockroach debug zip now properly skips over fully decommissioned nodes. #48095
- cockroach debug zip now tries multiple times to retrieve data using SQL if it encounters retry errors. #48098
- cockroach debug zip now supports two command-line parameters: --nodes and --exclude-nodes. When specified, they control which nodes are inspected when gathering the data. This makes it possible to focus on a group of nodes of interest in a large cluster, or to exclude nodes that cockroach debug zip would have trouble reaching otherwise. Both flags accept a list of individual node IDs or ranges of node IDs, e.g. --nodes=1,10,13-15. #48098
Performance improvements
- Previously, CockroachDB could incorrectly consider a non-NULL value from an interleaved parent table to be NULL when the interleaved child has a NULL value in the row with the corresponding index key. This bug has been fixed. #47104
- A data race on AST nodes for SELECT statements that include a WINDOW definition has been fixed. Previously, these queries could have returned incorrect results. #47176
- Previously, a panic could occur when SHOW RANGES or SHOW RANGE FOR ROW was called with a virtual table. This bug has been fixed. #47516
- Fixed incorrect results that could occur when casting negative intervals or timestamps to type decimal. #47521
- Previously, when the query was executed with the row-by-row engine, CockroachDB could incorrectly return no output instead of returning a parsing error in queries with count(*). This bug has been fixed. #47486
- Previously, CockroachDB incorrectly released the memory used in hash aggregation operations, which could lead to node crashes. This bug has been fixed. #47519
- Previously, PARTITION BY and ORDER BY columns in window specifications lost qualifications when used inside views. This bug has been fixed. #47716
- Fixed a bug where target column specifications in IMPORT INTO were ignored. #47796
- Columns named with reserved keywords and/or other special characters are now correctly handled. #47796
- CockroachDB will now avoid producing a severe "internal error" upon certain privilege check failures with pg_catalog built-in functions. #48243
- Fixed a bug causing cascading deletes to fail when deleting thousands of rows across interleaved tables. #48287
- Fixed a rare bug that could lead to data corruption or data loss if a replica was both the source of a snapshot, was being concurrently removed from the range, and if certain specific conditions exist inside RocksDB. #48319
- Fixed a rare bug where stats were not automatically generated for a new table. #48028
- Fixed a rare bug where stats refreshes could fail. CockroachDB now triggers stats refreshing after completing an import job, after the transaction finishes the job commits. #48028
- Fixed an error that occurred when statistics collection was explicitly requested on a column with type ARRAY. #48344
- Fixed a rare bug causing a range to deadlock and all the writes to the respective range to timeout. #48304
- Fixed a bug causing HTTP requests to fail with error 503 "transport: authentication handshake failed: io: read/write on closed pipe" and continue failing until the node was restarted. #48482
- cockroach debug zip can now successfully avoid out-of-memory errors when extracting very large system or crdb_internal tables. #48098
- cockroach debug zip will now properly report an error if an error is encountered while writing the end of the output ZIP file. #48098
- Fixed a bug that caused vectorized queries on composite data types to occasionally return invalid data. #48464
- Previously, SHOW STATISTICS USING JSON output contained incorrect single quotes for strings with spaces inside histograms. This bug has been fixed. #48545
- Fixed a bug preventing timestamps from being closed, which could result in failed follower reads or failure to observe resolved timestamps in changefeeds. #48683
- Fixed a bug that falsely indicated that kv.closed_timestamp.max_behind_nanos was almost always growing. #48690
- CockroachDB now prevents dropping databases that contain tables that are currently offline due to IMPORT or RESTORE. Previously, dropping a database in this state could lead to a corrupted schema, which prevented running backups. #48612
- Fixed a bug that caused cockroach dump to erroneously include an additional CREATE UNIQUE INDEX "primary" ... INTERLEAVE IN PARENT statement in the dump output on tables with interleaved primary keys. This bug made it impossible to re-import dumped data without manual editing. #48777
- Fixed a bug that caused SHOW CREATE statements to sometimes show a partitioning step for an index that was previously dropped. #48767
- Fixed a bug that caused changefeeds that were created with a cursor, and that encounter a retriable error before writing their first checkpoint, to perform full-table backfills upon restart. #48752
- Fixed a bug that could cause canceled changefeeds to not stop. #48752
What's New in v19.1.9
- Fixed a bug in the histogram filtering logic of the optimizer which was causing inaccurate cardinality estimates for queries with equality predicates on UUIDs and strings, as well as some other types. This bug has existed since histograms were first introduced into the optimizer in the v19.2.0 release. Fixing it improves the optimizer's cardinality estimates and results in better query plans in some cases. #48625
- Histograms used by the optimizer for query planning now have more accurate row counts per histogram bucket, particularly for columns that have many NULL values. This results in better plans in some cases. #48645
- Fixed a performance inefficiency in the vectorized execution engine. This fix speeds up all queries that are executed with the vectorized engine, with most noticeable gains on the queries that output many rows. #48733
Backward-incompatible changesSecurity updates
- Previously, the phase of server shutdown responsible for range lease transfers to other nodes would give up after 10,000 attempts of transferring replica leases away, regardless of the value of server.shutdown.lease_transfer_wait. The limit of 10,000 attempts has been removed, so that now only the maximum duration server.shutdown.lease_transfer_wait applies. #47698
- The textual error and warning messages displayed by cockroach quit under various circumstances have been updated. Meanwhile, the message "ok" remains as indicator that the operation has likely succeeded. #47698
- cockroach quit now prints out progress details on its standard error stream, even when --logtostderr is not specified. Previously, nothing was printed on standard error. Scripts that wish to ignore this output can redirect the stderr stream. #47698
General changes
- Non-licensed users are now able to add more principals to the special superuser role/group admin. Note: Creation of additional roles is still a licensed feature. #45396
SQL language changes
- Previously, the phase of server shutdown responsible for range lease transfers to other nodes had a hard timeout of 5 seconds. This patch makes this timeout configurable via the new cluster setting server.shutdown.lease_transfer_wait. #47698
Command-line changes
- It is now possible to use GRANT and REVOKE to add users to the admin role without a valid license. This change aims to enable use of the Admin UI and other privileged features without a license. #45396
- The type checking code now prefers aggregate overloads with string inputs if there are multiple possible candidates due to arguments of unknown type. #46902
- Added a new "unimplemented" error when attempting to ADD CONSTRAINT with the EXCLUDE USING syntax. #46912
- Added support for using CREATE INDEX ... INCLUDE (col1, col2, ...), which is an alias that PostgreSQL uses that is analogous to our STORING (col1, col2, ...) syntax. #46912
- Added support for parsing the REINDEX syntax, which results in an "unimplemented" error that explains that REINDEXing is not required in CockroachDB. #46912
- CockroachDB now parses the CREATE INDEX CONCURRENTLY and DROP INDEX CONCURRENTLY syntaxes, which return errors when used. #46808
Admin UI changes
- cockroach debug zip now avoids creating invalid zip files if some of its requests encounter an error. #46637
- The time that cockroach quit waits client-side for the node to drain (remove existing clients and push range leases away) is now configurable via the command-line flag --drain-wait. Note that separate server-side timeouts also apply separately; check the server.shutdown.* cluster settings for details. #47698
- It is now possible to drain a node without shutting down the process, using cockroach node drain. This makes it easier to integrate with service managers and orchestration: it now becomes safe to issue cockroach node drain and then separately stop the service via a process manager or orchestrator. Without this new mode, there is a risk to misconfigure the service manager to auto-restart the node after it shuts down via quit, in a way that's surprising or unwanted. The new command node drain also recognizes the new --drain-wait flag. #47698
- The default value of the parameter --drain-wait for cockroach quit has been increased from 1 minute to 10 minutes, to give more time for nodes with thousands of ranges to migrate their leases away. #47698
- The commands cockroach quit and cockroach node drain now report a "work remaining" metric on their standard error stream. The value reduces until it reaches 0, to indicate that the graceful shutdown has completed server-side. An operator can now rely on cockroach node drain to obtain confidence of a graceful shutdown prior to terminating the server process. #47698
Bug fixes
- Metrics relating to SQL transaction restarts and rollbacks are now properly captured and exported. #46273
- Fixed a "cannot map variable" error in some rare cases involving joins. #44860
- Fixed incorrect de-duplication of impure expressions (like gen_random_uuid) in projections and default values. #44916
- Fixed an internal error that could occur when NULLIF was called with one null argument. #45391
- It is now possible to create inverted indexes on columns whose names are mixed-case. #45678
- Previously, drivers that did not truncate trailing zeroes for decimals in the binary format ended up having inaccuracies of up to 10^4 during the decode step. Fixed this error by truncating the trailing zeroes as appropriate. This fixes known incorrect decoding cases with Postgrex in Elixir. #45671
- Fixed a name resolution error that could occur when a common table expression (CTE) was referenced in the SELECT list of a query using the syntax <cte-name>.<col-name>. #45782
- Previously, CockroachDB could crash when computing window functions with RANGE mode of framing when one of the bounds was either of offset PRECEDING or offset FOLLOWING type when there were NULL values in the single column from ORDER BY clause. Additionally, in RANGE mode bounds 0 PRECEDING and 0 FOLLOWING could be handled incorrectly. Now this has been fixed. #45806
- Fixed an internal error that could occur in the optimizer when a WHERE filter contained at least one correlated subquery and one non-correlated subquery. #46168
- CockroachDB now properly supports using --url with query options (e.g., application_name) without specifying sslmode. The default of sslmode=disable is assumed in that case. #46480
- Fixed a bug where operations on an index that contained a collated string in descending order would fail. #46579
- Fixed an incorrect query result that could occur when a scalar aggregate was called with a null input. #46902
- Fixed a data race on AST nodes for SELECT statements that include a WINDOW clause. It is unclear whether this could have resulted in incorrect results being returned for these queries. #47177
- Fixed incorrect results that could occur when casting negative intervals or timestamps to type decimal. #47524
- Previously, CockroachDB was incorrectly releasing memory used by hash aggregation. This could lead to a crash (which was more likely when hash aggregation had store on the order of 100k of groups) and is now fixed. #47520
- Fixed a bug that could lead to data corruption or data loss if a replica was both the source of a snapshot and was being concurrently removed from the range. This scenario is rare, but possible. #48317