Skip to content

Commit

Permalink
ddl: handle create writer error for index ingest operator (#53916) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Aug 5, 2024
1 parent 8f9bc9a commit 74d9a23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/ddl/backfilling_operators.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ func NewIndexIngestOperator(
writer, err := engines[i].CreateWriter(writerID)
if err != nil {
logutil.Logger(ctx).Error("create index ingest worker failed", zap.Error(err))
ctx.onError(err)
return nil
}
writers = append(writers, writer)
Expand Down
6 changes: 6 additions & 0 deletions pkg/ddl/ingest/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"path/filepath"
"strconv"

"github.com/pingcap/failpoint"
"github.com/pingcap/tidb/pkg/config"
"github.com/pingcap/tidb/pkg/ddl/logutil"
"github.com/pingcap/tidb/pkg/lightning/log"
Expand Down Expand Up @@ -68,6 +69,11 @@ func InitGlobalLightningEnv(filterProcessingJobIDs FilterProcessingJobIDsFunc) {
} else {
memTotal = memTotal / 2
}
failpoint.Inject("setMemTotalInMB", func(val failpoint.Value) {
//nolint: forcetypeassert
i := val.(int)
memTotal = uint64(i) * size.MB
})
LitBackCtxMgr = NewLitBackendCtxMgr(sortPath, memTotal, filterProcessingJobIDs)
litRLimit = util.GenRLimit("ddl-ingest")
LitInitialized = true
Expand Down

0 comments on commit 74d9a23

Please sign in to comment.