Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: prompt k8s.io/api version (#11866) #11898

Open
wants to merge 1 commit into
base: release-7.1
Choose a base branch
from
Open
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
87 changes: 86 additions & 1 deletion cdc/puller/ddl_puller.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,87 @@ func (p *ddlJobPullerImpl) Output() <-chan *model.DDLJobEntry {
return p.outputCh
}

<<<<<<< HEAD
=======
// Input receives the raw kv entry and put it into the input channel.
func (p *ddlJobPullerImpl) Input(
ctx context.Context,
rawDDL *model.RawKVEntry,
_ []tablepb.Span,
_ model.ShouldSplitKVEntry,
) error {
p.sorter.AddEntry(ctx, model.NewPolymorphicEvent(rawDDL))
return nil
}

// handleRawKVEntry converts the raw kv entry to DDL job and sends it to the output channel.
func (p *ddlJobPullerImpl) handleRawKVEntry(ctx context.Context, ddlRawKV *model.RawKVEntry) error {
if ddlRawKV == nil {
return nil
}

if ddlRawKV.OpType == model.OpTypeResolved {
// Only nil in unit test case.
if p.schemaStorage != nil {
p.schemaStorage.AdvanceResolvedTs(ddlRawKV.CRTs)
}
if ddlRawKV.CRTs > p.getResolvedTs() {
p.setResolvedTs(ddlRawKV.CRTs)
}
}

job, err := p.unmarshalDDL(ctx, ddlRawKV)
if err != nil {
return errors.Trace(err)
}

if job != nil {
skip, err := p.handleJob(job)
if err != nil {
return err
}
if skip {
return nil
}
log.Info("a new ddl job is received",
zap.String("namespace", p.changefeedID.Namespace),
zap.String("changefeed", p.changefeedID.ID),
zap.String("schema", job.SchemaName),
zap.String("table", job.TableName),
zap.Uint64("startTs", job.StartTS),
zap.Uint64("finishedTs", job.BinlogInfo.FinishedTS),
zap.String("query", job.Query),
zap.Any("job", job))
}

jobEntry := &model.DDLJobEntry{
Job: job,
OpType: ddlRawKV.OpType,
CRTs: ddlRawKV.CRTs,
}
select {
case <-ctx.Done():
return ctx.Err()
case p.outputCh <- jobEntry:
}
return nil
}

func (p *ddlJobPullerImpl) unmarshalDDL(ctx context.Context, rawKV *model.RawKVEntry) (*timodel.Job, error) {
if rawKV.OpType != model.OpTypePut {
return nil, nil
}
if p.ddlTableInfo == nil && !entry.IsLegacyFormatJob(rawKV) {
err := p.initDDLTableInfo(ctx)
if err != nil {
return nil, errors.Trace(err)
}
}

return entry.ParseDDLJob(rawKV, p.ddlTableInfo)
}

>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))
func (p *ddlJobPullerImpl) getResolvedTs() uint64 {
return atomic.LoadUint64(&p.resolvedTs)
}
Expand All @@ -168,7 +249,11 @@ func (p *ddlJobPullerImpl) setResolvedTs(ts uint64) {
atomic.StoreUint64(&p.resolvedTs, ts)
}

<<<<<<< HEAD
func (p *ddlJobPullerImpl) initJobTableMeta() error {
=======
func (p *ddlJobPullerImpl) initDDLTableInfo(ctx context.Context) error {
>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))
version, err := p.kvStorage.CurrentVersion(tidbkv.GlobalTxnScope)
if err != nil {
return errors.Trace(err)
Expand All @@ -188,7 +273,7 @@ func (p *ddlJobPullerImpl) initJobTableMeta() error {
return errors.Trace(err)
}

tbls, err := snap.ListTables(db.ID)
tbls, err := snap.ListTables(ctx, db.ID)
if err != nil {
return errors.Trace(err)
}
Expand Down
1 change: 1 addition & 0 deletions dm/checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ func (c *Checker) Init(ctx context.Context) (err error) {
newLightningPrecheckAdaptor(targetInfoGetter, info),
cpdb,
pdClient,
targetDB,
)

if _, ok := c.checkingItems[config.LightningFreeSpaceChecking]; ok {
Expand Down
107 changes: 107 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ require (
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
github.com/pierrec/lz4/v4 v4.1.17
github.com/pingcap/check v0.0.0-20211026125417-57bd13f7b5f0
<<<<<<< HEAD
github.com/pingcap/errors v0.11.5-0.20231212100244-799fae176cfb
github.com/pingcap/failpoint v0.0.0-20220801062533-2eaa32854a6c
github.com/pingcap/kvproto v0.0.0-20231011074246-fa00d2b03372
Expand All @@ -69,6 +70,17 @@ require (
github.com/pingcap/tidb/parser v0.0.0-20241104025918-bc77c51092c9
github.com/prometheus/client_golang v1.15.1
github.com/prometheus/client_model v0.3.0
=======
github.com/pingcap/errors v0.11.5-0.20240318064555-6bd07397691f
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86
github.com/pingcap/kvproto v0.0.0-20241120022153-92b0414aeed8
github.com/pingcap/log v1.1.1-0.20240314023424-862ccc32f18d
github.com/pingcap/tidb v1.1.0-beta.0.20241128113414-7518a29fb1d0
github.com/pingcap/tidb-dashboard v0.0.0-20240326110213-9768844ff5d7
github.com/pingcap/tidb/pkg/parser v0.0.0-20241119124618-50b5cd27d413
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/client_model v0.6.1
>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))
github.com/r3labs/diff v1.1.0
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/robfig/cron v1.2.0
Expand All @@ -83,9 +95,16 @@ require (
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.8.3
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954
<<<<<<< HEAD
github.com/tikv/client-go/v2 v2.0.8-0.20240710074042-ce640b992b7c
github.com/tikv/pd v1.1.0-beta.0.20230203015356-248b3f0be132
github.com/tikv/pd/client v0.0.0-20240725070735-fb162bf0aa3f
=======
github.com/thanhpk/randstr v1.0.6
github.com/tikv/client-go/v2 v2.0.8-0.20241120024459-05d115b3e88b
github.com/tikv/pd v1.1.0-beta.0.20240407022249-7179657d129b
github.com/tikv/pd/client v0.0.0-20241111073742-238d4d79ea31
>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))
github.com/tinylib/msgp v1.1.6
github.com/uber-go/atomic v1.4.0
github.com/vmihailenco/msgpack/v5 v5.3.5
Expand Down Expand Up @@ -119,7 +138,89 @@ require (
upper.io/db.v3 v3.7.1+incompatible
)

<<<<<<< HEAD
require github.com/pingcap/tidb/pkg/parser v0.0.0-20231103042308-035ad5ccbe67 // indirect
=======
require (
cloud.google.com/go/kms v1.15.8 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/apache/arrow/go/v12 v12.0.1 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.6 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.36 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.30 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.30 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.12.14 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.14.14 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.20.1 // indirect
github.com/aws/smithy-go v1.13.5 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/dolthub/maphash v0.1.0 // indirect
github.com/dolthub/swiss v0.2.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/getsentry/sentry-go v0.27.0 // indirect
github.com/go-asn1-ber/asn1-ber v1.5.4 // indirect
github.com/go-ldap/ldap/v3 v3.4.4 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-resty/resty/v2 v2.11.0 // indirect
github.com/goccy/go-reflect v1.2.0 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/influxdata/tdigest v0.0.1 // indirect
github.com/jellydator/ttlcache/v3 v3.0.1 // indirect
github.com/jfcg/sixb v1.3.8 // indirect
github.com/jfcg/sorty/v2 v2.1.0 // indirect
github.com/joomcode/errorx v1.0.1 // indirect
github.com/klauspost/asmfmt v1.3.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/ks3sdklib/aws-sdk-go v1.2.9 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/otiai10/copy v1.2.0 // indirect
github.com/qri-io/jsonpointer v0.1.1 // indirect
github.com/qri-io/jsonschema v0.2.1 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/tidwall/btree v1.7.0 // indirect
github.com/tidwall/buntdb v1.3.0 // indirect
github.com/tidwall/gjson v1.14.3 // indirect
github.com/tidwall/grect v0.1.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/zeebo/xxh3 v1.0.2 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.22.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.22.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto v0.0.0-20240401170217-c3f982113cda // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
k8s.io/api v0.29.11 // indirect
k8s.io/apimachinery v0.29.11 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
)
>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))

require (
cloud.google.com/go v0.110.0 // indirect
Expand Down Expand Up @@ -241,9 +342,15 @@ require (
github.com/pingcap/badger v1.5.1-0.20230103063557-828f39b09b6d // indirect
github.com/pingcap/fn v0.0.0-20200306044125-d5540d389059 // indirect
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989 // indirect
<<<<<<< HEAD
github.com/pingcap/sysutil v1.0.1-0.20230407040306-fb007c5aff21
github.com/pingcap/tipb v0.0.0-20230919054518-dfd7d194838f // indirect
github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect
=======
github.com/pingcap/sysutil v1.0.1-0.20240311050922-ae81ee01f3a5
github.com/pingcap/tipb v0.0.0-20241105053214-f91fdb81a69e // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
>>>>>>> 690b2a954f (*: prompt k8s.io/api version (#11866))
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b // indirect
Expand Down
Loading
Loading