Skip to content

1.0 Release notes and known limitations #1381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 10, 2017
Merged

Conversation

jseldess
Copy link
Contributor

@jseldess jseldess commented May 8, 2017

  • Add v1.0 known limitations
  • Add known limitations page to sidenav

This change is Reviewable


As a workaround, [execute the file from the command line](use-the-built-in-sql-client.html#execute-sql-statements-from-a-file) instead of from within the interactive shell.

## New values generated by `DEFAULT` expressions during `ALTER TABLE ADD COLUMN`
Copy link
Contributor Author

@jseldess jseldess May 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knz, @andreimatei, the following is based on cockroachdb/cockroach#15633. Please check. If anything needs to be changed or added, I'd appreciate draft language.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me


In the [built-in SQL shell](use-the-built-in-sql-client.html), each previously executed command is stored in the SQL shell history. In cases where identical commands are executed consecutively, this can make it incoventient to return to a command prior to the identical batch of commands.

## Using `\|` to perform a large input in the SQL shell
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knz, the following is based on cockroachdb/cockroach#15645. Please check and let me know if anything should be changed/expanded.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


The `unique_rowid()` [function](functions-and-operators.html) returns values that cannot be represented exactly by numbers in Javascript. For example, a `235191684988928001` value returned by `unique_rowid()` would get represented as `235191684988928000` in Javascript. Notice that the last digit is different. In such cases, if the Javascript application temporarily stores the value `235191684988928001` and queries using it, it won't match the value that actually got stored.

## Repeated commands in the SQL shell history
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@knz, the following is based on cockroachdb/cockroach#14938. Please check and let me know if anything should be changed/expanded.


This limitations may be particularly relevant if you are using a simple SQL table of two columns to [simulate direct KV access](frequently-asked-questions.html#can-i-use-cockroachdb-as-a-key-value-store). In that case, be sure to use the `UPSERT` statement.

## `unique_rowid()` values in Javascript
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petermattis, the following is based on cockroachdb/cockroach#15721. Please let me know if we need more details, and if we have a specific suggested workaround.


<div id="toc"></div>

## `INSERT ON CONFLICT` vs. `UPSERT`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danhhz, the following is based on cockroachdb/cockroach#14482. We've documented this elsewhere already, but nonetheless, let me know if anything needs tweaking here.

@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

I could use help adding more known limitations to this PR. If I've put your name next to one, I'd greatly appreciate it if you would add a comment to this PR with suggested language for explaining/describing the known limitation. If you don't have time to help, please suggest someone else.

@jseldess jseldess force-pushed the known-limitations branch from 220bf4c to 90b910f Compare May 8, 2017 03:24

## `unique_rowid()` values in Javascript

The `unique_rowid()` [function](functions-and-operators.html) returns values that cannot be represented exactly by numbers in Javascript. For example, a `235191684988928001` value returned by `unique_rowid()` would get represented as `235191684988928000` in Javascript. Notice that the last digit is different. In such cases, if the Javascript application temporarily stores the value `235191684988928001` and queries using it, it won't match the value that actually got stored.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workaround is to ensure that the JavaScript code that uses a column initialized with unique_rowid converts the id value to a string server-side before inspecting/using it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


## Repeated commands in the SQL shell history

In the [built-in SQL shell](use-the-built-in-sql-client.html), each previously executed command is stored in the SQL shell history. In cases where identical commands are executed consecutively, this can make it incoventient to return to a command prior to the identical batch of commands.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incoventient -> inconvenient

Also, I have tried to reproduce #14938 and was unable to. It does not appear that we duplicate the history, as the issue implies. I would be more cautious with the phrasing, for example:

"In the built-in SQL shell, each previously executed command is stored in the SQL shell history. In some cases, commands are unexpectedly duplicated in the history."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


In the [built-in SQL shell](use-the-built-in-sql-client.html), each previously executed command is stored in the SQL shell history. In cases where identical commands are executed consecutively, this can make it incoventient to return to a command prior to the identical batch of commands.

## Using `\|` to perform a large input in the SQL shell
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


In the [built-in SQL shell](use-the-built-in-sql-client.html), using the [`\|`](use-the-built-in-sql-client.html#sql-shell-commands) operator to perform a large number of queries from a file can cause the server to close the connection. This is because `\|` sends the entire file as a single query to the server, which can exceed the upper bound on the size of a packet the server can accept from any client (16MB).

As a workaround, [execute the file from the command line](use-the-built-in-sql-client.html#execute-sql-statements-from-a-file) instead of from within the interactive shell.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be more concrete here and say [ execute ... ]( ... ) with "cat data.sql | cockroach sql", instead ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.


As a workaround, [execute the file from the command line](use-the-built-in-sql-client.html#execute-sql-statements-from-a-file) instead of from within the interactive shell.

## New values generated by `DEFAULT` expressions during `ALTER TABLE ADD COLUMN`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works for me

@knz
Copy link
Contributor

knz commented May 8, 2017

Some additional limitations:

  • support for grouping DDL (schema change) statements inside a transaction is limited; and so is the combination of DDL and DML statements operating on the new schema inside the same transaction. For details see here: https://github.com/cockroachdb/cockroach/projects/4 (we may need a better high-level overview, @dt and @vivekmenezes can provide)

  • by default, a single transaction can contain at most 100000 write operations (e.g. changes to individual row cells) and at most 64MiB of combined updates. These limits are configurable with the cluster settings kv.raft.command.max_size and kv.transaction.max_intents however non-default values are not supported yet. #15350

  • the combined size of all the values in the columns of a single column family on a single row should not exceed the configured range size (see zone configs, 64MiB by default) for that table, or otherwise a write may fail or general cluster slowness may ensue. #15770

  • the mechanisms implemented inside CockroachDB to limit the number of clients and queries based on how much free RAM is available are not complete: on a loaded system, there exists a combination of high number of simultaneous connections and number of running queries beyond which the node accepting them may crash due to memory exhaustion. This can be prevented by monitoring CockroachDB memory usage and ensuring there is some margin between maximum CockroachDB memory usage and available system RAM. See #8879 and this blog post.

  • many SQL operators (ORDER BY, UNION/INTERSECT/EXCEPT, GROUP BY, subqueries, window functions) accumulate intermediate results in RAM on the node where the operator is processed. If the operator attempts to process more rows than can fit into RAM, either a memory capacity error will be reported to the client that issued the query, or the node may crash. See #15206 #8879 #5807 and this blog post.

  • using COUNT(DISTINCT t.*) to count distinct pairs of only one table when multiple tables are selected (e.g. via a join) will return incorrect results. To work around, list the columns explicitly with e.g. COUNT(DISTINCT (t.x, t.y, ...)). #15750

  • the two previous points imply in particular that it is not yet possible to store BLOBs larger than 64MB (recommended: less than 32MiB) inside a single table cell in CockroachDB, without changing internal tuning parameters to non-supported values. #15771

@knz
Copy link
Contributor

knz commented May 8, 2017

The point about UUIDs is not a known limitation, it's rather a non-standard SQL feature which we have chosen not to implement yet. I'm not sure we want to make a list of every SQL feature under the sun that other RDBMs support but we don't.

@eisenstatdavid
Copy link

eisenstatdavid commented May 8, 2017

sql: roundtrip to string -- "queries with constant expressions that evaluate to 2**-63 may be incorrectly rejected".

sql: improve overload resolution -- "many string operations are not properly overloaded for collated strings".

@petermattis
Copy link
Contributor

  • TRUNCATE may fail with errors about commands being "too large". The implementation of TRUNCATE is currently quite inefficient. A workaround is to use DROP TABLE instead and to subsequently recreate the table.

Review status: 0 of 2 files reviewed at latest revision, 8 unresolved discussions.


Comments from Reviewable

@jseldess jseldess changed the title Known limitations [WIP] Known limitations May 8, 2017
@jseldess jseldess force-pushed the known-limitations branch from 90b910f to 6976b3c Compare May 8, 2017 14:34
@petermattis
Copy link
Contributor

Review status: 0 of 2 files reviewed at latest revision, 9 unresolved discussions.


v1.0-known-limitations.md, line 19 at r4 (raw file):

1. Use [`SHOW CREATE TABLE`](show-create-table.html) to get the table schema.
2. Use [`DROP TABLE`](drop-table.html) to remove the table.
3. Use [`CREATE TABLE`](create-table.html) with the output from step 1 to recreate the table.

:lgtm:


Comments from Reviewable

@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

@eisenstatdavid, can you please provide a concrete SQL example for each? These single sentences don't feel like quite enough.

sql: roundtrip to string -- "queries with constant expressions that evaluate to 2**-63 may be incorrectly rejected".
sql: improve overload resolution -- "many string operations are not properly overloaded for collated strings".

@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

@knz, thanks for adding those additional known limitations, but shouldn't there be cockroach issues with the known-limitation flag for each one of them to ensure that we investigate and possible resolve them in the future? I'd hate for this PR to be the only record.

@eisenstatdavid
Copy link

roundtrip:

root@:26257/> create database d;
CREATE DATABASE
root@:26257/> create table d.t (i int primary key);
CREATE TABLE
root@:26257/> select * from d.t where (i, 2*i) < (42, -9223372036854775807 - 1);
pq: ($0, 2 * $0) < (42, - 9223372036854775808:::INT): tuples ($0, 2 * $0), (42, - 9223372036854775808:::INT) are not comparable at index 2: numeric constant out of int64 range

overloads:

root@:26257/> select 'string1' || 'string2';
+------------------------+
| 'string1' || 'string2' |
+------------------------+
| string1string2         |
+------------------------+
(1 row)
root@:26257/> select ('string1' collate en) || ('string2' collate en);
pq: unsupported binary operator: <collatedstring{en}> || <collatedstring{en}>

@a-robinson
Copy link
Contributor

storage: Load-based lease rebalancing performs poorly if localities are under-specified in uneven latency deployments. This isn't likely to effect most people, and I'm not sure how to make it clear without being pretty long-winded but here's a somewhat condensed explanation:

If your cluster:

  1. is running in datacenters that are very different distances away from each other (e.g. from datacenter A to datacenter B is 10ms and from A to C is 100ms)
  2. has a single locality label assigned to each datacenter (e.g. --locality datacenter=a)
  3. gets most of its requests sent to a single datacenter because that's where all your application traffic is

...then you might see increased latency caused by a continuously high rate of lease transfers between datacenters. You can tell whether this is happening by seeing whether the "Leases Transferred / second" line on the "Replication Queue" graph on the "Queues" dashboard of the admin UI is consistently larger than 0.

If you're seeing this problem, you can fix it (thus improving request latency) by adding a second tier to each node's locality specification. In the example above where A and B are close together and C is far apart, you might change A and B's localities to --locality region=foo,datacenter=a and --locality region=foo,datacenter=b while changing C's to --locality region=bar,datacenter=c. This will inform the replication logic about A and B's relative proximity.

@knz
Copy link
Contributor

knz commented May 8, 2017

@jseldess I have added the links to issues in my previous comment

@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

Thanks, @a-robinson. I reworked your explanation a bit. Please take a look.

Copy link
Contributor

@a-robinson a-robinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lease transfer limitation LGTM other than a minor clarification. Thanks Jesse!

- Each node was started with a single tier of `--locality`, e.g., `--locality=datacenter=a`.
- Most client requests get sent to a single datacenter because that's where all your application traffic is.

To detect that this is happening, open the [Admin UI](explore-the-admin-ui.html), select the **Queues** dashboard, hover over the **Replication Queue** graph, and check the **Leases Transferred / second** data point. If that data point is larger than 0, you should consider stopping and restarting each node with additional tiers of locality to improve request latency.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not necessarily bad if the data point is larger than 0 once in a while. The issue is if it's continuously/consistently greater than 0, indicating that leases are constantly being transferred. The occasional transfer is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@jseldess jseldess force-pushed the known-limitations branch from 134444f to 5e6f60e Compare May 8, 2017 20:08
@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

@knz, that UUID issue is flagged as a known limitation. Should we remove the label?

@petermattis
Copy link
Contributor

@jseldess Yes, the lack of UUID support doesn't fall under my definition of known-limitation. We can't document all of our missing functionality. I think known-limitation should be constrained to functionality that we're providing but which has significant limitations, surprises or bugs.

@jseldess
Copy link
Contributor Author

jseldess commented May 8, 2017

Got it, @petermattis. I'll remove it from my list.

@jess-edwards
Copy link
Contributor

@jseldess This is looking great.

Copy link
Contributor

@bdarnell bdarnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Don't forget to fill in the date (in two places) before pressing the button.

@jseldess
Copy link
Contributor Author

jseldess commented May 10, 2017

@jseldess
Copy link
Contributor Author

@tamird, @eisenstatdavid, @jordanlewis: can one of you write up this know limitation for me, with any workarounds? cockroachdb/cockroach#15800

- A [`CREATE TABLE`](create-table.html) statement containing [`FOREIGN KEY`](foreign-key.html) or [`INTERLEAVE`](interleave-in-parent.html) clauses cannot be followed by statements that reference the new table.
- A table cannot be dropped and then recreated with the same name. This is not possible within a single transaction because `DROP TABLE` does not immediately drop the name of the table. As a workaround, split the [`DROP TABLE`](drop-table.html) and [`CREATE TABLE`](create-table.html) statements into separate transactions.

## Nodes need access to the first key-value range on startup
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spencerkimball, @a-robinson, is this sufficient for documenting cockroachdb/cockroach#13027? If not, please help me revise/expand as necessary.

@eisenstatdavid
Copy link

I think that the select max(true) panic was introduced subsequent to rc2, but I'll double check and get back to you if not.

@eisenstatdavid
Copy link

Indeed, rc2 is fine.

@jseldess
Copy link
Contributor Author

Thanks, @eisenstatdavid.


## Query planning for `OR` expressions

Given a query like `SELECT * FROM foo WHERE a > 1 OR b > 2`, even if there are appropriate indexes to satisfy both `a > 1` and `b > 2`, the query planner will perform a full table or index scan because it can't use both conditions at once.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@a-robinson
Copy link
Contributor

Review status: 0 of 6 files reviewed at latest revision, 20 unresolved discussions, some commit checks failed.


known-limitations.md, line 29 at r11 (raw file):

Previously, jseldess wrote…

@spencerkimball, @a-robinson, is this sufficient for documenting cockroachdb/cockroach#13027? If not, please help me revise/expand as necessary.

First off, this only affects clusters that are being restarted with entirely new IP addresses. I'd frame the known limitation as only affecting situations in which you're restoring a backup onto a new set of machines that have different IP addresses.

Second, I'm fairly confident that telling the first node to join itself won't actually fix the problem. Even if I did think that it would work, we never actually tested it so I'd still be a little hesitant to rely on recommending that. Instead, I'd either suggest including all node addresses in the join flags or including node (n-1)'s address (or n for the first node) when restoring from backup onto a new set of machines.


Comments from Reviewable

@jseldess jseldess force-pushed the known-limitations branch from f41f87c to 230bd90 Compare May 10, 2017 13:48
@a-robinson
Copy link
Contributor

Review status: 0 of 10 files reviewed at latest revision, 21 unresolved discussions.


known-limitations.md, line 31 at r11 (raw file):

## Nodes need access to the first key-value range on startup

As show in our [deployment tutorials](manual-deployment.html), when starting the first node of a cluster, the `--join` flag should be empty, but when starting all subsequent nodes, `--join` should be set to the address of node 1. This approach ensures that all nodes have access to a copy of the first key-value range, which is part of a meta-index identifying where all range replicas are stored, and which nodes requires to initialize themselves and start accepting incoming connections.

s/As show/As shown/


Comments from Reviewable

@cockroach-teamcity
Copy link
Member

1 similar comment
@cockroach-teamcity
Copy link
Member

@jseldess jseldess changed the title [WIP] 1.0 Release notes and known limitations 1.0 Release notes and known limitations May 10, 2017
@a-robinson
Copy link
Contributor

:lgtm: other than my last two comments


Reviewed 1 of 4 files at r8, 1 of 4 files at r9, 2 of 3 files at r10, 2 of 2 files at r11, 3 of 6 files at r12.
Review status: 7 of 10 files reviewed at latest revision, 21 unresolved discussions, some commit checks failed.


Comments from Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants