Skip to content

sql: tolerate non-existent databases for plan cache invalidation#35151

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190222-opt-schema
Feb 25, 2019
Merged

sql: tolerate non-existent databases for plan cache invalidation#35151
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190222-opt-schema

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Feb 22, 2019

Fixes #35145.

Release note (bug fix): CockroachDB again properly reports when a
database used during PREPARE does not exist any more when EXECUTE is
used.

@knz knz requested review from a team, RaduBerinde and jordanlewis February 22, 2019 14:47
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis, @knz, and @RaduBerinde)


pkg/sql/logictest/testdata/logic_test/prepare, line 960 at r1 (raw file):

subtest regression_35145

# Verify db-independent query returns valid results even when db does not exist

[nit] s/valid results even/the expected error/ ?


pkg/sql/logictest/testdata/logic_test/prepare, line 974 at r1 (raw file):


statement ok
CREATE DATABASE d35145; SET database = d35145; DROP DATABASE d35145

A little confused by this test - is there a reason we don't prepare the statement inside this db?

@knz knz force-pushed the 20190222-opt-schema branch from 585b433 to 1064580 Compare February 25, 2019 15:57
Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

RFAL

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis and @RaduBerinde)


pkg/sql/logictest/testdata/logic_test/prepare, line 960 at r1 (raw file):

Previously, RaduBerinde wrote…

[nit] s/valid results even/the expected error/ ?

Yep, thanks.


pkg/sql/logictest/testdata/logic_test/prepare, line 974 at r1 (raw file):

Previously, RaduBerinde wrote…

A little confused by this test - is there a reason we don't prepare the statement inside this db?

Your question makes me realize there are two relevant cases for the test. Clarified.

Copy link
Copy Markdown
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis, @knz, and @RaduBerinde)


pkg/sql/logictest/testdata/logic_test/prepare, line 978 at r2 (raw file):

ap35145

subtest regression_35145_prepared_db_disappears

It doesn't look like this subtest would function separately of the statements above. I'd replace this with a comment. Same below.

Release note (bug fix): CockroachDB again properly reports when a
database used during PREPARE does not exist any more when EXECUTE is
used.
@knz knz force-pushed the 20190222-opt-schema branch from 1064580 to f069ca9 Compare February 25, 2019 17:01
Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @jordanlewis and @RaduBerinde)


pkg/sql/logictest/testdata/logic_test/prepare, line 978 at r2 (raw file):

Previously, RaduBerinde wrote…

It doesn't look like this subtest would function separately of the statements above. I'd replace this with a comment. Same below.

Done.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

TFYR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Build failed

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Build failed (retrying...)

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Not awaiting review

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Canceled

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r+

craig bot pushed a commit that referenced this pull request Feb 25, 2019
35077: workload: add indexes workload r=nvanbenschoten a=nvanbenschoten

Closes #34912.

This adds a new workload called `indexes`. Unlike `kv`, the workload is
specifically designed to stress secondary indexes. Its schema looks
like:

```
CREATE TABLE indexes (
    key     UUID  NOT NULL PRIMARY KEY,
    col0    INT   NOT NULL,
    col1    INT   NOT NULL,
    col2    INT   NOT NULL,
    col3    INT   NOT NULL,
    col4    INT   NOT NULL,
    col5    INT   NOT NULL,
    col6    INT   NOT NULL,
    col7    INT   NOT NULL,
    col8    INT   NOT NULL,
    col9    INT   NOT NULL,
    payload BYTES NOT NULL
)
```

and it includes knobs to specify how many of the "col" columns should be
indexed and whether they should be indexed using a UNIQUE specifier. The
workload also includes a knob to specify the size of the `payload`
column.

Release note: None

35116: sql: add support for extra session vars for pg compatibility r=knz a=knz

Fixes #35109.

This adds compatibility support for the following variables, with only
the default values that make sense in CockroachDB:

- `row_security`
- `synchronize_seqscans`,
- `lock_timeout`,
- `idle_in_transaction_session_timeout`

Release note: None

35134: storageccl: leave params in workload URIs r=dt a=dt

workload URIs do not contain anything sensitive and including them in the job make it easier see what it was actually doing.

Release note: none.

35151: sql: tolerate non-existent databases for plan cache invalidation r=knz a=knz

Fixes  #35145.

Release note (bug fix): CockroachDB again properly reports when a
database used during PREPARE does not exist any more when EXECUTE is
used.

35162: storage: remove TODOs in cmd_push_txn r=nvanbenschoten a=nvanbenschoten

This was discussed in #33523 (review) but I missed digging into it at the time. I still don't think I have my head fully wrapped around it, but I do enough to know that it's not something I want to start pulling on right now.

Release note: None

Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Build succeeded

@craig craig bot merged commit f069ca9 into cockroachdb:master Feb 25, 2019
@knz knz deleted the 20190222-opt-schema branch February 25, 2019 22:16
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.

sql: PGAssertionError: schema for virtual table not found

3 participants