Skip to content

Commit

Permalink
streamingccl: use mutex to buffer split point in event stream
Browse files Browse the repository at this point in the history
Epic: none

Release note: none
  • Loading branch information
msbutler committed May 2, 2024
1 parent 0c8a1cf commit bb9a627
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ccl/streamingccl/streamproducer/event_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ func (s *eventStream) onMetadata(ctx context.Context, metadata *kvpb.RangeFeedMe
if metadata.FromManualSplit && !metadata.Span.Key.Equal(metadata.ParentStartKey) {
// Only send new manual split keys (i.e. a child rangefeed start key that
// differs from the parent start key)
if s.addMu != nil {
// Split points can be sent concurrently during the initial scan.
s.addMu.Lock()
defer s.addMu.Unlock()
}
s.seb.addSplitPoint(metadata.Span.Key)
s.setErr(s.maybeFlushBatch(ctx))
}
}

Expand Down

0 comments on commit bb9a627

Please sign in to comment.