-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: calling String() on some ColumnDescriptors (and possibly other types) can panic #63379
Comments
This issue is very unfortunate because gogo proto is not able to convert non-protobuf data type with its Why gogo proto need to convert a non-protobuf type to string? you may ask. The culprit is So not just But after walk through the text marshaling code of gogo, I find it does support repeated type but you need to tell it that your type is a repeated one through
These tags does not do anything except for telling gogo "hey, these. are repeated types". But it's so weird that we put these tags here even it's not a protobuf struct. So far I'm not sure how these tags would affect json pb unmarshaling. Anyone familiar with that? otherwise I would need to look into the code more to figure out or trust our test coverage lol... |
What if we implement the |
That won't work because this is only check at the top level of the struct, it doesn't check for child field types..... that's very unfortunate as well. |
oh @ajwerner you might be right, it's also checked here : https://github.com/gogo/protobuf/blob/226206f39bd7276e88ec684ea0028c18ec2c91ae/proto/text.go#L594 |
…face Fixes cockroachdb#63379 `types.EnumMetadata` needs to implement `encoding.TextMarshaler` interface so that goto/protobuf won't panic when text marshaling protobuf struct has child field of type `types.EnumMetadata`. See the issue for more details why it would fail without this fix. Release note: None
…face Fixes cockroachdb#63379 Having `types.T` to implement the `encoding.TextMarshaler` interface to avoid panics when gogo/protobuf tries to text marshal any protobuf struct which has direct/indirect `types.T` child. The panics was caused by non-protobuf types in `types.EnumMetadata`. This fix implements the `MarshalText` method to ignore user defined metadata. Only InternalType is dumped. Release note: None
72638: catalog/lease: avoid using context.Background directly r=ajwerner a=knz First commit from #72651 Informs #58938. - `(*AmbientContext).AnnotateCtx()` - takes care of connecting the context to the tracer - `logtags.FromContext` / `logtags.WithTags` - reproduces the logging tags on the child context. Release note: None 72640: sql/types: types.EnumMetadata implements encoding.TextMarshaler interface r=chengxiong-ruan a=chengxiong-ruan Fixes #63379 `types.EnumMetadata` needs to implement `encoding.TextMarshaler` interface so that goto/protobuf won't panic when text marshaling protobuf struct has child field of type `types.EnumMetadata`. See the issue for more details why it would fail without this fix. Release note: None 72644: server: improve the tenant context r=RaduBerinde a=knz All commits but the last from #72638 (Reviewers: only review last commit) Informs #58938 72647: admission,server: context improvements r=RaduBerinde a=knz All commits but the last 2 from #72644 (Reviewers: only review last 2 commits) Informs #58938 72650: streamingest: wait for all goroutines on streamIngestProcessor shutdown r=andreimatei a=andreimatei This processor was failing to stop and wait for some of the goroutines it spawned, which is not nice (in particular, it's likely that those goroutines were using a tracing span after it was finished). Release note: None 72652: internal/sqlsmith: do not use crdb_internal.start_replication_stream r=yuzefovich a=yuzefovich Fixes: #72633. Fixes: #72634. Release note: None 72661: migration: add missing leaktests r=andreimatei a=andreimatei Release note: None 72668: roachtest: add assignment-cast related failures to pgjdbc r=RichardJCai a=rafiss fixes #72636 Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Chengxiong Ruan <[email protected]> Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Rafi Shamim <[email protected]>
Describe the problem
(This might be a dupe of #63299)
If we run
\set auto_trace=on,kv
and thenALTER TABLE foo SET LOCALITY REGIONAL BY ROW
, you may receive trace data that shows evidence of a panic:The following test is capable of reproducing this particular panic:
which will fail with:
The text was updated successfully, but these errors were encountered: