Skip to content
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

sql: PGAssertionError: schema for virtual table not found #35145

Closed
tbg opened this issue Feb 22, 2019 · 3 comments · Fixed by #35151
Closed

sql: PGAssertionError: schema for virtual table not found #35145

tbg opened this issue Feb 22, 2019 · 3 comments · Fixed by #35151
Assignees
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.

Comments

@tbg
Copy link
Member

tbg commented Feb 22, 2019

Run the sequelize example against master:

$ npm install
$ make
> [email protected] start /Users/tschottdorf/go/src/github.com/cockroachdb/examples-orms/node/sequelize
> node ./app.js

body-parser deprecated bodyParser: use individual json/urlencoded middlewares app.js:12:9
body-parser deprecated undefined extended: provide extended option node_modules/body-parser/index.js:105:29
(node:94685) DeprecationWarning: Using the automatically created return value from client.query as an event emitter is deprecated and will be removed in [email protected]. Please see the upgrade guide at https://node-postgres.com/guides/upgrading
Unhandled rejection error: internal error: schema for virtual table not found
    at Connection.parseE (/Users/tschottdorf/go/src/github.com/cockroachdb/examples-orms/node/sequelize/node_modules/pg/lib/connection.js:567:11)
    at Connection.parseMessage (/Users/tschottdorf/go/src/github.com/cockroachdb/examples-orms/node/sequelize/node_modules/pg/lib/connection.js:391:17)
    at Socket.<anonymous> (/Users/tschottdorf/go/src/github.com/cockroachdb/examples-orms/node/sequelize/node_modules/pg/lib/connection.js:129:22)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onread (net.js:638:20)

I'm not sure if this works against past versions (haven't checked), but since this is an "assertion error" it seems that an example shouldn't be able to trigger it.

@tbg tbg assigned knz Feb 22, 2019
@tbg tbg added the C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. label Feb 22, 2019
@jordanlewis
Copy link
Member

It looks like this might be new / changed in the optimizer. Now that I think about it, I've started to see this error when there's a missing database for someone who expects one.

Here's a quick repro. Start a server, and then in another window, open a connection to a non-existant database.

[8:33]% ./cockroach sql --insecure --database=foo 
# Welcome to the cockroach SQL interface.
# All statements must be terminated by a semicolon.
# To exit: CTRL + D.
#
warning: unable to retrieve the server's version: pq: internal error: schema for virtual table not found
#
# Enter \? for a brief introduction.
#
warning: error retrieving the database name: pq: database "foo" does not exist
root@:26257/?>

@jordanlewis
Copy link
Member

@RaduBerinde you might know more about this.

@knz
Copy link
Contributor

knz commented Feb 22, 2019

I think I know how to fix the internal error, but the sequelize example must be updated too.

craig bot pushed a commit that referenced this issue 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 <[email protected]>
Co-authored-by: Raphael 'kena' Poss <[email protected]>
Co-authored-by: David Taylor <[email protected]>
@craig craig bot closed this as completed in #35151 Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants