Skip to content
Draft
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
2 changes: 1 addition & 1 deletion logservice/eventstore/pebble.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func newPebbleOptions(dbNum int) *pebble.Options {

MaxOpenFiles: maxOpenFilesPerDB,

MaxConcurrentCompactions: func() int { return 6 },
MaxConcurrentCompactions: func() int { return 2 },

// Decrease compaction frequency
L0CompactionThreshold: 20,
Expand Down
Loading