Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions logservice/eventstore/event_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ func (e *eventStore) Close(_ context.Context) error {
}

func (e *eventStore) RegisterDispatcher(
_ common.ChangeFeedID,
changefeedID common.ChangeFeedID,
dispatcherID common.DispatcherID,
dispatcherSpan *heartbeatpb.TableSpan,
startTs uint64,
Expand Down Expand Up @@ -678,7 +678,15 @@ func (e *eventStore) RegisterDispatcher(
serverConfig := config.GetGlobalServerConfig()
resolvedTsAdvanceInterval := int64(serverConfig.KVClient.AdvanceIntervalInMs)
// Note: don't hold any lock when call Subscribe
e.subClient.Subscribe(subStat.subID, *dispatcherSpan, startTs, consumeKVEvents, advanceResolvedTs, resolvedTsAdvanceInterval, bdrMode)
e.subClient.Subscribe(
subStat.subID,
logpuller.NewChangefeedSubscriptionMeta(changefeedID),
*dispatcherSpan,
startTs,
consumeKVEvents,
advanceResolvedTs,
resolvedTsAdvanceInterval,
bdrMode)
log.Info("new subscription created",
zap.Stringer("dispatcherID", dispatcherID),
zap.Uint64("startTs", startTs),
Expand Down
2 changes: 2 additions & 0 deletions logservice/eventstore/event_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ func (s *mockSubscriptionClient) AllocSubscriptionID() logpuller.SubscriptionID

func (s *mockSubscriptionClient) Subscribe(
subID logpuller.SubscriptionID,
meta logpuller.SubscriptionMeta,
span heartbeatpb.TableSpan,
startTs uint64,
consumeKVEvents func(raw []common.RawKVEntry, wakeCallback func()) bool,
advanceResolvedTs func(ts uint64),
advanceInterval int64,
bdrMode bool,
) {
_ = meta
s.mu.Lock()
defer s.mu.Unlock()
s.subscriptions[subID] = &mockSubscriptionStat{
Expand Down
11 changes: 11 additions & 0 deletions logservice/logpuller/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ func (e *rpcCtxUnavailableErr) Error() string {
e.verID.GetID(), e.verID.GetVer(), e.verID.GetConfVer())
}

type rpcCtxChangedError struct {
verID tikv.RegionVerID
from string
to string
}

func (e *rpcCtxChangedError) Error() string {
return fmt.Sprintf("rpcCtx for region %v changed from %s to %s. ver:%v, confver:%v",
e.verID.GetID(), e.from, e.to, e.verID.GetVer(), e.verID.GetConfVer())
}

type getStoreErr struct{}

func (e *getStoreErr) Error() string { return "get store error" }
Expand Down
Loading
Loading