João Reis created CASSGO-141:
--------------------------------

             Summary: Composite type codecs retain reference to parent 
RegisteredTypes instead of Session registry
                 Key: CASSGO-141
                 URL: https://issues.apache.org/jira/browse/CASSGO-141
             Project: Apache Cassandra Go driver
          Issue Type: Bug
          Components: Core
            Reporter: João Reis
            Assignee: Bohdan Siryk


h3. Problem Description

When a {{Session}} is initialized, it creates a shallow copy of the cluster's 
type registry ({{s.types = cfg.RegisteredTypes.Copy()}}).

However, the built-in codecs for composite and nested types ({{list}}, {{set}}, 
{{map}}, {{tuple}}, {{udt}}, and {{vector}}) maintain an internal reference to 
the {{RegisteredTypes}} registry to parse nested type strings (e.g. 
{{TypeInfoFromString}} calling {{types.typeInfoFromString}}). Because 
{{Copy()}} does not rebind these internal references to the new session copy, 
the codecs inside the session continue referencing the source 
{{ClusterConfig.RegisteredTypes}} or {{GlobalTypes}}.

h3. User Impact

1. *Nested Type Resolution*: Any custom types or type configurations registered 
on or copied for a specific session are bypassed when resolving nested element 
types within collections, tuples, UDTs, or vectors, falling back to the 
parent/global registry instead.
2. *Configuration Isolation*: Settings applied to a copied type registry (such 
as UDT encoding options or custom type mappings) do not propagate properly to 
nested type handling within composite columns.

h3. Proposed Fix

In {{RegisteredTypes.Copy()}}, rebind the internal {{types}} reference on 
built-in composite codecs to point to the newly created {{RegisteredTypes}} 
copy.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to