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

nil pointer dereference in resharder identifyRuleType #9576

Closed
mvh-stripe opened this issue Jan 28, 2022 · 2 comments · Fixed by #9578
Closed

nil pointer dereference in resharder identifyRuleType #9576

mvh-stripe opened this issue Jan 28, 2022 · 2 comments · Fixed by #9578
Assignees
Milestone

Comments

@mvh-stripe
Copy link
Contributor

mvh-stripe commented Jan 28, 2022

Overview of the Issue

We hit a SIGSEGV when trying to split an existing shard.

2022-01-21T23:57:52.003657374Z stderr F I0121 23:57:52.003518       1 workflow.go:402] In VReplicationWorkflow.initReshard() for Parameters: &{WorkflowType:1 Workflow:split_-55 TargetKeyspace:keyspace1 Cells: TabletTypes:primary,replica,rdonly ExcludeTables: EnableReverseReplication:false DryRun:false KeepData:false Timeout:0s Direction:0 SourceKeyspace:keyspace1 Tables: AllTables:false RenameTables:false SourceShards:[-55] TargetShards:[-1780 1780-1788 1788-55] SkipSchemaCopy:false AutoStart:true StopAfterCopy:false ExternalCluster:}
2022-01-21T23:57:52.003683408Z stderr F State: Not Created
2022-01-21T23:57:52.07294912Z stderr F I0121 23:57:52.072844       1 resharder.go:277] found internal table _7decd7b1_7948_11ec_a1f5_06784fed54f7_20220119165441_vrepl, ignoring in resharding
2022-01-21T23:57:52.075092901Z stderr F panic: runtime error: invalid memory address or nil pointer dereference
2022-01-21T23:57:52.07511149Z stderr F [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0xf11c81]
2022-01-21T23:57:52.075115562Z stderr F
2022-01-21T23:57:52.075121784Z stderr F goroutine 440 [running]:
2022-01-21T23:57:52.075132586Z stderr F vitess.io/vitess/go/vt/wrangler.(*resharder).identifyRuleType(0xc000122210, 0xc00062f050)
2022-01-21T23:57:52.075143001Z stderr F         external/io_vitess_vitess/go/vt/wrangler/resharder.go:282 +0xe1
2022-01-21T23:57:52.075150229Z stderr F vitess.io/vitess/go/vt/wrangler.(*resharder).blsIsReference(0xc000437340, 0xc0004ae0b0)
2022-01-21T23:57:52.075153362Z stderr F         external/io_vitess_vitess/go/vt/wrangler/resharder.go:252 +0x7c
2022-01-21T23:57:52.075156944Z stderr F vitess.io/vitess/go/vt/wrangler.(*resharder).readRefStreams.func1(0xc000206000)
2022-01-21T23:57:52.075160157Z stderr F         external/io_vitess_vitess/go/vt/wrangler/resharder.go:217 +0x5d4
2022-01-21T23:57:52.075187948Z stderr F vitess.io/vitess/go/vt/wrangler.(*resharder).forAll.func1(0xc00094c000)
2022-01-21T23:57:52.075277362Z stderr F         external/io_vitess_vitess/go/vt/wrangler/resharder.go:368 +0x68
2022-01-21T23:57:52.075287346Z stderr F created by vitess.io/vitess/go/vt/wrangler.(*resharder).forAll
2022-01-21T23:57:52.075294259Z stderr F         external/io_vitess_vitess/go/vt/wrangler/resharder.go:365 +0x65

We are running a slightly older version (checkout commit-SHA 92beb23) if you want the line numbers in traceback to align.

I think the problem is in https://github.com/vitessio/vitess/blob/main/go/vt/wrangler/resharder.go#L280
When it finds an internal table that should be ignored, it should maybe return workflow.StreamTypeSharded? Currently it attempts to access vtable.Type but vtable is nil because we cannot find vschema for an internal table.

@aquarapid
Copy link
Contributor

Yes, agree with your assessment; Maybe just guard the if with vtable != nil && .... We will need to add a test to catch this.

@aquarapid aquarapid added this to the v13.0 milestone Jan 28, 2022
@mattlord mattlord self-assigned this Jan 31, 2022
@mattlord mattlord linked a pull request Jan 31, 2022 that will close this issue
3 tasks
@mattlord
Copy link
Contributor

mattlord commented Jan 31, 2022

Closing this as fixed via #9578

I apologize, I had missed this separate issue at first but it's the same underlying issue as in #9577.

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

Successfully merging a pull request may close this issue.

3 participants