fix: panic when schema change (#42727)

issue: #42723

Signed-off-by: chyezh <chyezh@outlook.com>
This commit is contained in:
Zhen Ye 2025-06-13 17:43:07 +08:00 committed by GitHub
parent d0eabf0807
commit 4f5409e1fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -145,6 +145,7 @@ func NewDispatcher(
pchannel: pchannel,
targets: typeutil.NewConcurrentMap[string, *target](),
stream: stream,
includeSkipWhenSplit: includeSkipWhenSplit,
}
metrics.NumConsumers.WithLabelValues(paramtable.GetRole(), fmt.Sprint(paramtable.GetNodeID())).Inc()
@ -271,7 +272,6 @@ func (d *Dispatcher) work() {
log.Debug("skip msg info",
zap.String("vchannel", vchannel),
zap.String("msgType", msg.Type().String()),
zap.Int64("msgID", msg.ID()),
zap.Uint64("msgBeginTs", msg.BeginTs()),
zap.Uint64("msgEndTs", msg.EndTs()),
zap.Uint64("packBeginTs", p.BeginTs),

View File

@ -127,6 +127,10 @@ type SchemaChangeMessageBody struct {
SchemaChangeMessage message.ImmutableSchemaChangeMessageV2
}
func (s *SchemaChangeMessageBody) ID() msgstream.UniqueID {
return 0
}
func NewSchemaChangeMessageBody(msg message.ImmutableMessage) (msgstream.TsMsg, error) {
schChgMsg, err := message.AsImmutableCollectionSchemaChangeV2(msg)
if err != nil {