Cockroach: sentry: (0) table.go:879: virtual descriptors cannot be stored, found: %v | *sqlbase.MutableTableDescriptor (see stack traces in additional data)

Created on 26 Jun 2019  路  5Comments  路  Source: cockroachdb/cockroach

This issue was autofiled by Sentry. It represents a crash or reported error on a live cluster with telemetry enabled.

Sentry link: https://sentry.io/organizations/cockroach-labs/issues/1087088546/?referrer=webhooks_plugin

Panic message:

(0) table.go:879: virtual descriptors cannot be stored, found: %v | *sqlbase.MutableTableDescriptor
(see stack traces in additional data)


Stacktrace (expand for inline code snippets):

https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/table.go#L878-L880 in pkg/sql.(planner).writeTableDescToBatch
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/table.go#L865-L867 in pkg/sql.(
planner).writeTableDesc
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/table.go#L839-L841 in pkg/sql.(planner).writeSchemaChange
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/create_view.go#L169-L171 in pkg/sql.(
createViewNode).startExec
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/plan.go#L495-L497 in pkg/sql.startExec.func2
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/walk.go#L144-L146 in pkg/sql.(planVisitor).visitInternal.func1
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/walk.go#L615-L617 in pkg/sql.(
planVisitor).visitInternal
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/walk.go#L111-L113 in pkg/sql.(planVisitor).visit
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/walk.go#L75-L77 in pkg/sql.walkPlan
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/plan.go#L498-L500 in pkg/sql.startExec
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/plan_node_to_row_source.go#L123-L125 in pkg/sql.(
planNodeToRowSource).Start
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/distsqlrun/processors.go#L799-L801 in pkg/sql/distsqlrun.(ProcessorBase).Run
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/distsqlrun/flow.go#L625-L627 in pkg/sql/distsqlrun.(
Flow).Run
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/distsql_running.go#L251-L253 in pkg/sql.(DistSQLPlanner).Run
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/distsql_running.go#L838-L840 in pkg/sql.(
DistSQLPlanner).PlanAndRun
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor_exec.go#L1111-L1113 in pkg/sql.(connExecutor).execWithDistSQLEngine
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor_exec.go#L947-L949 in pkg/sql.(
connExecutor).dispatchToExecutionEngine
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor_exec.go#L455-L457 in pkg/sql.(connExecutor).execStmtInOpenState
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor_exec.go#L101-L103 in pkg/sql.(
connExecutor).execStmt
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor.go#L1181-L1183 in pkg/sql.(connExecutor).run
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/conn_executor.go#L432-L434 in pkg/sql.(
Server).ServeConn
https://github.com/cockroachdb/cockroach/blob/25dd36f0139bf65b80758deeeccf35ee17ebd622/pkg/sql/pgwire/conn.go#L336-L338 in pkg/sql/pgwire.(*conn).serveImpl.func4

pkg/sql/table.go in pkg/sql.(*planner).writeTableDescToBatch at line 879
pkg/sql/table.go in pkg/sql.(*planner).writeTableDesc at line 866
pkg/sql/table.go in pkg/sql.(*planner).writeSchemaChange at line 840
pkg/sql/create_view.go in pkg/sql.(*createViewNode).startExec at line 170
pkg/sql/plan.go in pkg/sql.startExec.func2 at line 496
pkg/sql/walk.go in pkg/sql.(*planVisitor).visitInternal.func1 at line 145
pkg/sql/walk.go in pkg/sql.(*planVisitor).visitInternal at line 616
pkg/sql/walk.go in pkg/sql.(*planVisitor).visit at line 112
pkg/sql/walk.go in pkg/sql.walkPlan at line 76
pkg/sql/plan.go in pkg/sql.startExec at line 499
pkg/sql/plan_node_to_row_source.go in pkg/sql.(*planNodeToRowSource).Start at line 124
pkg/sql/distsqlrun/processors.go in pkg/sql/distsqlrun.(*ProcessorBase).Run at line 800
pkg/sql/distsqlrun/flow.go in pkg/sql/distsqlrun.(*Flow).Run at line 626
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).Run at line 252
pkg/sql/distsql_running.go in pkg/sql.(*DistSQLPlanner).PlanAndRun at line 839
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execWithDistSQLEngine at line 1112
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).dispatchToExecutionEngine at line 948
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmtInOpenState at line 456
pkg/sql/conn_executor_exec.go in pkg/sql.(*connExecutor).execStmt at line 102
pkg/sql/conn_executor.go in pkg/sql.(*connExecutor).run at line 1182
pkg/sql/conn_executor.go in pkg/sql.(*Server).ServeConn at line 433
pkg/sql/pgwire/conn.go in pkg/sql/pgwire.(*conn).serveImpl.func4 at line 337

| Tag | Value |
|---|---|
| Cockroach Release | v19.1.0 |
| Cockroach SHA: | 25dd36f0139bf65b80758deeeccf35ee17ebd622 |
| Platform | darwin amd64 |
| Distribution | CCL |
| Environment | v19.1.0 |
| Command | server |
| Go Version | go1.11.6|
| # of CPUs |8 |
| # of Goroutines |206 |

C-bug O-sentry

Most helpful comment

Ha, it just so happens I've been working on that (https://github.com/cockroachdb/cockroach/pull/39169) and I hit a similar error during development. It was because I was reporting a dependency on a virtual table. This situation is similar, except that we have a virtual view. I will work on fixing this too as part of that PR.

All 5 comments

This might be me. Is this expected?

pq: internal error: virtual descriptors cannot be stored, found: name:"ranges" id:4294967270 parent_id:0 version:1 modification_time:<> columns:<name:"range_id" id:1 type:<semantic_type:INT width:64 precision:0 visible_type:BIGINT > nullable:false hidden:false > columns:<name:"start_key" id:2 type:<semantic_type:BYTES width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"start_pretty" id:3 type:<semantic_type:STRING width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"end_key" id:4 type:<semantic_type:BYTES width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"end_pretty" id:5 type:<semantic_type:STRING width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"database_name" id:6 type:<semantic_type:STRING width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"table_name" id:7 type:<semantic_type:STRING width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"index_name" id:8 type:<semantic_type:STRING width:0 precision:0 visible_type:NONE > nullable:false hidden:false > columns:<name:"replicas" id:9 type:<semantic_type:ARRAY width:64 precision:0 visible_type:BIGINT array_contents:INT > nullable:false hidden:false > columns:<name:"lease_holder" id:10 type:<semantic_type:INT width:64 precision:0 visible_type:BIGINT > nullable:false hidden:false > next_column_id:11 next_family_id:0 primary_index:<name:"" id:0 unique:false foreign_key:<table:0 index:0 name:"" validity:Validated shared_prefix_len:0 on_delete:NO_ACTION on_update:NO_ACTION match:SIMPLE > interleave:<> partitioning:<num_columns:0 > type:FORWARD > next_index_id:0 privileges:<users:<user:"public" privileges:32 > > next_mutation_id:1 format_version:3 state:PUBLIC view_query:"SELECT range_id, start_key, start_pretty, end_key, end_pretty, database_name, table_name, index_name, replicas, crdb_internal.lease_holder(start_key) AS lease_holder FROM crdb_internal.ranges_no_leases" dependedOnBy:<id:77 index_id:0 column_ids:1 column_ids:2 column_ids:3 column_ids:4 column_ids:5 column_ids:6 column_ids:7 column_ids:8 column_ids:9 column_ids:10 > drop_time:0 replacement_of:<id:0 time:<> > audit_mode:DISABLED drop_job_id:0
DETAIL: stack trace:
github.com/cockroachdb/cockroach/pkg/sql/table.go:879: in writeTableDescToBatch()
github.com/cockroachdb/cockroach/pkg/sql/table.go:866: in writeTableDesc()
github.com/cockroachdb/cockroach/pkg/sql/table.go:840: in writeSchemaChange()
github.com/cockroachdb/cockroach/pkg/sql/create_view.go:170: in startExec()
github.com/cockroachdb/cockroach/pkg/sql/plan.go:496: in func2()
github.com/cockroachdb/cockroach/pkg/sql/walk.go:145: in func1()
github.com/cockroachdb/cockroach/pkg/sql/walk.go:616: in visitInternal()
github.com/cockroachdb/cockroach/pkg/sql/walk.go:112: in visit()
github.com/cockroachdb/cockroach/pkg/sql/walk.go:76: in walkPlan()
github.com/cockroachdb/cockroach/pkg/sql/plan.go:499: in startExec()
github.com/cockroachdb/cockroach/pkg/sql/plan_node_to_row_source.go:124: in Start()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/processors.go:800: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsqlrun/flow.go:626: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:252: in Run()
github.com/cockroachdb/cockroach/pkg/sql/distsql_running.go:839: in PlanAndRun()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:1112: in execWithDistSQLEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:948: in dispatchToExecutionEngine()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:456: in execStmtInOpenState()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor_exec.go:102: in execStmt()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:1182: in run()
github.com/cockroachdb/cockroach/pkg/sql/conn_executor.go:433: in ServeConn()
github.com/cockroachdb/cockroach/pkg/sql/pgwire/conn.go:337: in func4()

HINT: You have encountered an unexpected error inside CockroachDB.

Please check https://github.com/cockroachdb/cockroach/issues to check
whether this problem is already tracked. If you cannot find it there,
please report the error with details at:

    https://github.com/cockroachdb/cockroach/issues/new/choose

If you would rather not post publicly, please contact us directly at:

    [email protected]

The Cockroach Labs team appreciates your feedback.

This happens when we attempt to create a view for crdb_internal.ranges.

CREATE VIEW test_view AS SELECT range_id, lease_holder FROM crdb_internal.ranges;

@RaduBerinde I haven't looked at this thoroughly but is this limitation liftable by moving view creation into opt by any chance?

Ha, it just so happens I've been working on that (https://github.com/cockroachdb/cockroach/pull/39169) and I hit a similar error during development. It was because I was reporting a dependency on a virtual table. This situation is similar, except that we have a virtual view. I will work on fixing this too as part of that PR.

@imjching this is the definition of crdb_internal.ranges:

CREATE VIEW crdb_internal.ranges AS SELECT
    range_id,
    start_key,
    start_pretty,
    end_key,
    end_pretty,
    database_name,
    table_name,
    index_name,
    replicas,
    learner_replicas,
    split_enforced_until,
    crdb_internal.lease_holder(start_key) AS lease_holder
FROM crdb_internal.ranges_no_leases

As a workaround, you can do:

CREATE VIEW test_view AS SELECT range_id, crdb_internal.lease_holder(start_key) AS lease_holder FROM crdb_internal.ranges_no_leases

Thanks for taking this on!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdarnell picture bdarnell  路  4Comments

HeikoOnnebrink picture HeikoOnnebrink  路  4Comments

jordanlewis picture jordanlewis  路  4Comments

danhhz picture danhhz  路  3Comments

richardanaya picture richardanaya  路  3Comments