Skip to content

Commit

Permalink
etcd_worker: batch etcd patch (#3277)
Browse files Browse the repository at this point in the history
  • Loading branch information
asddongmen authored and ti-chi-bot committed Nov 11, 2021
1 parent 70b29ac commit 36dc613
Show file tree
Hide file tree
Showing 14 changed files with 1,382 additions and 47 deletions.
3 changes: 2 additions & 1 deletion cdc/capture/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ func (c *Capture) runEtcdWorker(ctx cdcContext.Context, reactor orchestrator.Rea
if err != nil {
return errors.Trace(err)
}
if err := etcdWorker.Run(ctx, c.session, timerInterval); err != nil {
captureAddr := c.info.AdvertiseAddr
if err := etcdWorker.Run(ctx, c.session, timerInterval, captureAddr); err != nil {
// We check ttl of lease instead of check `session.Done`, because
// `session.Done` is only notified when etcd client establish a
// new keepalive request, there could be a time window as long as
Expand Down
2 changes: 2 additions & 0 deletions cdc/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/pingcap/ticdc/cdc/sorter/unified"
"github.com/pingcap/ticdc/pkg/actor"
"github.com/pingcap/ticdc/pkg/etcd"
"github.com/pingcap/ticdc/pkg/orchestrator"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -44,6 +45,7 @@ func init() {
etcd.InitMetrics(registry)
initServerMetrics(registry)
actor.InitMetrics(registry)
orchestrator.InitMetrics(registry)
// Sorter metrics
memory.InitMetrics(registry)
unified.InitMetrics(registry)
Expand Down
5 changes: 5 additions & 0 deletions errors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ error = '''
the etcd txn should be aborted and retried immediately
'''

["CDC:ErrEtcdTxnSizeExceed"]
error = '''
patch size of a single changefeed exceed etcd txn max size
'''

["CDC:ErrEventFeedAborted"]
error = '''
single event feed aborted
Expand Down
Loading

0 comments on commit 36dc613

Please sign in to comment.