mpp

package
v1.1.0-beta.0...-3047328 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalMPPCoordinator

func NewLocalMPPCoordinator(ctx context.Context, sctx sessionctx.Context, is infoschema.InfoSchema, plan base.PhysicalPlan, planIDs []int, startTS uint64, mppQueryID kv.MPPQueryID, gatherID uint64, coordinatorAddr string, memTracker *memory.Tracker) *localMppCoordinator

NewLocalMPPCoordinator creates a new localMppCoordinator instance

Types

type ExecutorWithRetry

type ExecutorWithRetry struct {

	// Expose to let MPPGather access.
	KVRanges []kv.KeyRange
	// contains filtered or unexported fields
}

ExecutorWithRetry receive mppResponse from localMppCoordinator, and tries to recovery mpp err if necessary. The abstraction layer of reading mpp resp:

  1. MPPGather: As part of the TiDB Volcano model executor, it is equivalent to a TableReader.
  2. selectResult: Decode select result(mppResponse) into chunk. Also record runtime info.
  3. ExecutorWithRetry: Recovery mpp err if possible and retry MPP Task.
  4. localMppCoordinator: Generate MPP fragment and dispatch MPPTask. And receive MPP status for better err msg and correct stats for Limit.
  5. mppIterator: Send or receive MPP RPC.

func NewExecutorWithRetry

func NewExecutorWithRetry(ctx context.Context, sctx sessionctx.Context, parentTracker *memory.Tracker, planIDs []int,
	plan plannercore.PhysicalPlan, startTS uint64, queryID kv.MPPQueryID,
	is infoschema.InfoSchema) (*ExecutorWithRetry, error)

NewExecutorWithRetry create ExecutorWithRetry.

func (*ExecutorWithRetry) Close

func (r *ExecutorWithRetry) Close() error

Close implements kv.Response interface.

func (*ExecutorWithRetry) Next

func (r *ExecutorWithRetry) Next(ctx context.Context) (resp kv.ResultSubset, err error)

Next implements kv.Response interface.

type RecoveryHandler

type RecoveryHandler struct {
	// contains filtered or unexported fields
}

RecoveryHandler tries to recovery mpp error.

func NewRecoveryHandler

func NewRecoveryHandler(useAutoScaler bool, holderCap uint64, enable bool, parent *memory.Tracker) *RecoveryHandler

NewRecoveryHandler returns new instance of RecoveryHandler.

func (*RecoveryHandler) CanHoldResult

func (m *RecoveryHandler) CanHoldResult() bool

CanHoldResult tells whether we can insert intermediate results.

func (*RecoveryHandler) Enabled

func (m *RecoveryHandler) Enabled() bool

Enabled return true when mpp err recovery enabled.

func (*RecoveryHandler) HoldResult

func (m *RecoveryHandler) HoldResult(resp *mppResponse)

HoldResult tries to hold mpp result. You should call Enabled() and CanHoldResult() to check first.

func (*RecoveryHandler) NumHoldResp

func (m *RecoveryHandler) NumHoldResp() int

NumHoldResp returns the number of resp holded.

func (*RecoveryHandler) PopFrontResp

func (m *RecoveryHandler) PopFrontResp() (*mppResponse, error)

PopFrontResp pop one resp.

func (*RecoveryHandler) Recovery

func (m *RecoveryHandler) Recovery(info *RecoveryInfo) error

Recovery tries to recovery error. Reasons that cannot recovery:

  1. Already return result to client because holder is full.
  2. Recovery method of this kind of error not implemented or error is not recoveryable.
  3. Retry time exceeds maxRecoveryCnt.

func (*RecoveryHandler) RecoveryCnt

func (m *RecoveryHandler) RecoveryCnt() uint32

RecoveryCnt returns the recovery count.

func (*RecoveryHandler) ResetHolder

func (m *RecoveryHandler) ResetHolder()

ResetHolder reset the dynamic data, like resps and recovery cnt. Will not touch other metadata, like enable.

type RecoveryInfo

type RecoveryInfo struct {
	MPPErr error

	// Nodes that involved into MPP computation.
	NodeCnt int
}

RecoveryInfo contains info that can help recovery error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL