tikv

package
v0.0.0-...-7ad6a20 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Follower = iota
	Leader
)

Follower will send detection rpc to Leader

Variables

View Source
var (
	ErrLockNotFound    = ErrRetryable("lock not found")
	ErrAlreadyRollback = ErrRetryable("already rollback")
	ErrReplaced        = ErrRetryable("replaced by another transaction")
)
View Source
var (
	InternalKeyPrefix        = []byte{0xff}
	InternalRegionMetaPrefix = append(InternalKeyPrefix, "region"...)
	InternalStoreMetaKey     = append(InternalKeyPrefix, "store"...)
	InternalSafePointKey     = append(InternalKeyPrefix, "safepoint"...)
)

Functions

func GetTS

func GetTS() (int64, int64)

func InternalRegionMetaKey

func InternalRegionMetaKey(regionId uint64) []byte

func NewDBWriter

func NewDBWriter(bundle *mvcc.DBBundle) mvcc.DBWriter

Types

type Detector

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

Detector detects deadlock.

func NewDetector

func NewDetector(ttl time.Duration, urgentSize uint64, expireInterval time.Duration) *Detector

NewDetector creates a new Detector.

func (*Detector) CleanUp

func (d *Detector) CleanUp(txn uint64)

CleanUp removes the wait for entry for the transaction.

func (*Detector) CleanUpWaitFor

func (d *Detector) CleanUpWaitFor(txn, waitForTxn, keyHash uint64)

CleanUpWaitFor removes a key in the wait for entry for the transaction.

func (*Detector) Detect

func (d *Detector) Detect(sourceTxn, waitForTxn, keyHash uint64) *ErrDeadlock

Detect detects deadlock for the sourceTxn on a locked key.

type DetectorClient

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

DetectorClient is a util used for distributed deadlock detection

func NewDetectorClient

func NewDetectorClient(waiterMgr *lockwaiter.Manager, pdClient pd.Client) *DetectorClient

NewDeadlockDetector will create a new detector util, entryTTL is used for recycling the lock wait edge in detector wait wap. chSize is the pending detection sending task size(used on non leader node)

func (*DetectorClient) CleanUp

func (dt *DetectorClient) CleanUp(startTs uint64)

user interfaces Cleanup processes cleaup task on local detector

func (*DetectorClient) CleanUpWaitFor

func (dt *DetectorClient) CleanUpWaitFor(txnTs, waitForTxn, keyHash uint64)

CleanUpWaitFor cleans up the specific wait edge in detector's wait map

func (*DetectorClient) Detect

func (dt *DetectorClient) Detect(txnTs uint64, waitForTxnTs uint64, keyHash uint64)

DetectRemote post the detection request to local deadlock detector or remote first region leader, the caller should use `waiter.ch` to receive possible deadlock response

type DetectorServer

type DetectorServer struct {
	Detector *Detector
	// contains filtered or unexported fields
}

func NewDetectorServer

func NewDetectorServer() *DetectorServer

NewDetectorServer creates local detector used by RPC detection handler

func (*DetectorServer) ChangeRole

func (ds *DetectorServer) ChangeRole(newRole int32)

func (*DetectorServer) Detect

func (*DetectorServer) IsLeader

func (ds *DetectorServer) IsLeader() bool

type ErrAlreadyCommitted

type ErrAlreadyCommitted uint64

ErrAlreadyCommitted is returned specially when client tries to rollback a committed lock.

func (ErrAlreadyCommitted) Error

func (e ErrAlreadyCommitted) Error() string

type ErrCommitExpire

type ErrCommitExpire struct {
	StartTs     uint64
	CommitTs    uint64
	MinCommitTs uint64
	Key         []byte
}

ErrCommitExpire is returned when commit key commitTs smaller than lock.MinCommitTs

func (*ErrCommitExpire) Error

func (e *ErrCommitExpire) Error() string

type ErrConflict

type ErrConflict struct {
	StartTS          uint64
	ConflictTS       uint64
	ConflictCommitTS uint64
	Key              []byte
}

func (*ErrConflict) Error

func (e *ErrConflict) Error() string

type ErrDeadlock

type ErrDeadlock struct {
	LockKey         []byte
	LockTS          uint64
	DeadlockKeyHash uint64
}

ErrDeadlock is returned when deadlock is detected.

func (ErrDeadlock) Error

func (e ErrDeadlock) Error() string

type ErrInvalidOp

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

func (ErrInvalidOp) Error

func (e ErrInvalidOp) Error() string

type ErrKeyAlreadyExists

type ErrKeyAlreadyExists struct {
	Key []byte
}

func (ErrKeyAlreadyExists) Error

func (e ErrKeyAlreadyExists) Error() string

type ErrLocked

type ErrLocked struct {
	Key  []byte
	Lock *mvcc.MvccLock
}

ErrLocked is returned when trying to Read/Write on a locked key. Client should backoff or cleanup the lock then retry.

func BuildLockErr

func BuildLockErr(key []byte, lock *mvcc.MvccLock) *ErrLocked

BuildLockErr generates ErrKeyLocked objects

func (*ErrLocked) Error

func (e *ErrLocked) Error() string

Error formats the lock to a string.

type ErrRetryable

type ErrRetryable string

ErrRetryable suggests that client may restart the txn. e.g. write conflict.

func (ErrRetryable) Error

func (e ErrRetryable) Error() string

type ErrTxnNotFound

type ErrTxnNotFound struct {
	StartTS    uint64
	PrimaryKey []byte
}

ErrTxnNotFound is returned if the required txn info not found on storage

func (*ErrTxnNotFound) Error

func (e *ErrTxnNotFound) Error() string

type GCCompactionFilter

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

GCCompactionFilter implements the badger.CompactionFilter interface.

func (*GCCompactionFilter) Filter

func (f *GCCompactionFilter) Filter(key, value, userMeta []byte) badger.Decision

Filter implements the badger.CompactionFilter interface. Since we use txn ts as badger version, we only need to filter Delete, Rollback and Op_Lock. It is called for the first valid version before safe point, older versions are discarded automatically.

func (*GCCompactionFilter) Guards

func (f *GCCompactionFilter) Guards() []badger.Guard

type InnerServer

type InnerServer interface {
	Setup(pdClient pd.Client)
	Start(pdClient pd.Client) error
	Stop() error
	Raft(stream tikvpb.Tikv_RaftServer) error
	BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error
	Snapshot(stream tikvpb.Tikv_SnapshotServer) error
}

type MPPTaskHandlerMap

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

type MVCCStore

type MVCCStore struct {
	DeadlockDetectCli *DetectorClient
	DeadlockDetectSvr *DetectorServer
	// contains filtered or unexported fields
}

MVCCStore is a wrapper of badger.DB to provide MVCC functions.

func NewMVCCStore

func NewMVCCStore(conf *config.Config, bundle *mvcc.DBBundle, dataDir string, safePoint *SafePoint,
	writer mvcc.DBWriter, pdClient pd.Client) *MVCCStore

NewMVCCStore creates a new MVCCStore

func (*MVCCStore) BatchGet

func (store *MVCCStore) BatchGet(reqCtx *requestCtx, keys [][]byte, version uint64) []*kvrpcpb.KvPair

func (*MVCCStore) CheckKeysLock

func (store *MVCCStore) CheckKeysLock(startTS uint64, resolved []uint64, keys ...[]byte) error

func (*MVCCStore) CheckRangeLock

func (store *MVCCStore) CheckRangeLock(startTS uint64, startKey, endKey []byte, resolved []uint64) error

func (*MVCCStore) CheckSecondaryLocks

func (store *MVCCStore) CheckSecondaryLocks(reqCtx *requestCtx, keys [][]byte, startTS uint64) (SecondaryLocksStatus, error)

func (*MVCCStore) CheckTxnStatus

func (store *MVCCStore) CheckTxnStatus(reqCtx *requestCtx,
	req *kvrpcpb.CheckTxnStatusRequest) (txnStatusRes TxnStatus, err error)

func (*MVCCStore) Cleanup

func (store *MVCCStore) Cleanup(reqCtx *requestCtx, key []byte, startTS, currentTs uint64) error

func (*MVCCStore) Close

func (store *MVCCStore) Close() error

func (*MVCCStore) Commit

func (store *MVCCStore) Commit(req *requestCtx, keys [][]byte, startTS, commitTS uint64) error

Commit implements the MVCCStore interface.

func (*MVCCStore) DeleteFileInRange

func (store *MVCCStore) DeleteFileInRange(start, end []byte)

func (*MVCCStore) MvccGetByKey

func (store *MVCCStore) MvccGetByKey(reqCtx *requestCtx, key []byte) (*kvrpcpb.MvccInfo, error)

MvccGetByKey gets mvcc information using input key as rawKey

func (*MVCCStore) MvccGetByStartTs

func (store *MVCCStore) MvccGetByStartTs(reqCtx *requestCtx, startTs uint64) (*kvrpcpb.MvccInfo, []byte, error)

func (*MVCCStore) PessimisticLock

func (store *MVCCStore) PessimisticLock(reqCtx *requestCtx, req *kvrpcpb.PessimisticLockRequest, resp *kvrpcpb.PessimisticLockResponse) (*lockwaiter.Waiter, error)

func (*MVCCStore) PessimisticRollback

func (store *MVCCStore) PessimisticRollback(reqCtx *requestCtx, req *kvrpcpb.PessimisticRollbackRequest) error

func (*MVCCStore) PhysicalScanLock

func (store *MVCCStore) PhysicalScanLock(startKey []byte, maxTS uint64, limit int) []*kvrpcpb.LockInfo

func (*MVCCStore) Prewrite

func (store *MVCCStore) Prewrite(reqCtx *requestCtx, req *kvrpcpb.PrewriteRequest) error

func (*MVCCStore) ResolveLock

func (store *MVCCStore) ResolveLock(reqCtx *requestCtx, lockKeys [][]byte, startTS, commitTS uint64) error

func (*MVCCStore) Rollback

func (store *MVCCStore) Rollback(reqCtx *requestCtx, keys [][]byte, startTS uint64) error

func (*MVCCStore) Scan

func (store *MVCCStore) Scan(reqCtx *requestCtx, req *kvrpcpb.ScanRequest) []*kvrpcpb.KvPair

func (*MVCCStore) ScanLock

func (store *MVCCStore) ScanLock(reqCtx *requestCtx, maxTS uint64, limit int) ([]*kvrpcpb.LockInfo, error)

func (*MVCCStore) StartDeadlockDetection

func (store *MVCCStore) StartDeadlockDetection(isRaft bool)

func (*MVCCStore) TxnHeartBeat

func (store *MVCCStore) TxnHeartBeat(reqCtx *requestCtx, req *kvrpcpb.TxnHeartBeatRequest) (lockTTL uint64, err error)

func (*MVCCStore) UpdateSafePoint

func (store *MVCCStore) UpdateSafePoint(safePoint uint64)

type MockPD

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

func NewMockPD

func NewMockPD(rm *MockRegionManager) *MockPD

func (*MockPD) AllocID

func (pd *MockPD) AllocID(ctx context.Context) (uint64, error)

func (*MockPD) AskBatchSplit

func (pd *MockPD) AskBatchSplit(ctx context.Context, region *metapb.Region, count int) (*pdpb.AskBatchSplitResponse, error)

func (*MockPD) AskSplit

func (pd *MockPD) AskSplit(ctx context.Context, region *metapb.Region) (*pdpb.AskSplitResponse, error)

func (*MockPD) Bootstrap

func (pd *MockPD) Bootstrap(ctx context.Context, store *metapb.Store, region *metapb.Region) (*pdpb.BootstrapResponse, error)

func (*MockPD) Close

func (pd *MockPD) Close()

func (*MockPD) GetAllStores

func (pd *MockPD) GetAllStores(ctx context.Context, opts ...pdclient.GetStoreOption) ([]*metapb.Store, error)

func (*MockPD) GetClusterID

func (pd *MockPD) GetClusterID(ctx context.Context) uint64

func (*MockPD) GetGCSafePoint

func (pd *MockPD) GetGCSafePoint(ctx context.Context) (uint64, error)

func (*MockPD) GetPrevRegion

func (pd *MockPD) GetPrevRegion(ctx context.Context, key []byte) (*pdclient.Region, error)

func (*MockPD) GetRegion

func (pd *MockPD) GetRegion(ctx context.Context, key []byte) (*pdclient.Region, error)

func (*MockPD) GetRegionByID

func (pd *MockPD) GetRegionByID(ctx context.Context, regionID uint64) (*pdclient.Region, error)

func (*MockPD) GetStore

func (pd *MockPD) GetStore(ctx context.Context, storeID uint64) (*metapb.Store, error)

func (*MockPD) GetTS

func (pd *MockPD) GetTS(ctx context.Context) (int64, int64, error)

func (*MockPD) IsBootstrapped

func (pd *MockPD) IsBootstrapped(ctx context.Context) (bool, error)

func (*MockPD) PutStore

func (pd *MockPD) PutStore(ctx context.Context, store *metapb.Store) error

func (*MockPD) ReportBatchSplit

func (pd *MockPD) ReportBatchSplit(ctx context.Context, regions []*metapb.Region) error

func (*MockPD) ReportRegion

func (pd *MockPD) ReportRegion(*pdpb.RegionHeartbeatRequest)

func (*MockPD) ScanRegions

func (pd *MockPD) ScanRegions(ctx context.Context, startKey []byte, endKey []byte, limit int) ([]*pdclient.Region, error)

func (*MockPD) ScatterRegion

func (pd *MockPD) ScatterRegion(ctx context.Context, regionID uint64) error

func (*MockPD) SetRegionHeartbeatResponseHandler

func (pd *MockPD) SetRegionHeartbeatResponseHandler(h func(*pdpb.RegionHeartbeatResponse))

func (*MockPD) StoreHeartbeat

func (pd *MockPD) StoreHeartbeat(ctx context.Context, stats *pdpb.StoreStats) error

func (*MockPD) UpdateGCSafePoint

func (pd *MockPD) UpdateGCSafePoint(ctx context.Context, safePoint uint64) (uint64, error)

type MockRegionManager

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

func NewMockRegionManager

func NewMockRegionManager(bundle *mvcc.DBBundle, clusterID uint64, opts RegionOptions) (*MockRegionManager, error)

func (*MockRegionManager) AddPeer

func (rm *MockRegionManager) AddPeer(regionID, storeID, peerID uint64)

func (*MockRegionManager) AddStore

func (rm *MockRegionManager) AddStore(storeID uint64, addr string, labels ...*metapb.StoreLabel)

AddStore adds a new Store to the cluster.

func (*MockRegionManager) AllocID

func (rm *MockRegionManager) AllocID() uint64

func (*MockRegionManager) AllocIDs

func (rm *MockRegionManager) AllocIDs(n int) []uint64

func (*MockRegionManager) Bootstrap

func (rm *MockRegionManager) Bootstrap(stores []*metapb.Store, region *metapb.Region) error

func (*MockRegionManager) Close

func (rm *MockRegionManager) Close() error

func (*MockRegionManager) GetAllStores

func (rm *MockRegionManager) GetAllStores() []*metapb.Store

func (*MockRegionManager) GetRegion

func (rm *MockRegionManager) GetRegion(id uint64) *metapb.Region

func (*MockRegionManager) GetRegionByEndKey

func (rm *MockRegionManager) GetRegionByEndKey(key []byte) (region *metapb.Region, peer *metapb.Peer)

func (*MockRegionManager) GetRegionByKey

func (rm *MockRegionManager) GetRegionByKey(key []byte) (region *metapb.Region, peer *metapb.Peer)

func (*MockRegionManager) GetRegionFromCtx

func (rm *MockRegionManager) GetRegionFromCtx(ctx *kvrpcpb.Context) (*regionCtx, *errorpb.Error)

func (*MockRegionManager) GetStoreAddrByStoreId

func (rm *MockRegionManager) GetStoreAddrByStoreId(storeId uint64) (string, error)

func (*MockRegionManager) GetStoreIDByAddr

func (rm *MockRegionManager) GetStoreIDByAddr(addr string) (uint64, error)

func (*MockRegionManager) GetStoreInfoFromCtx

func (rm *MockRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)

func (*MockRegionManager) IsBootstrapped

func (rm *MockRegionManager) IsBootstrapped() (bool, error)

func (*MockRegionManager) RemoveStore

func (rm *MockRegionManager) RemoveStore(storeID uint64)

RemoveStore removes a Store from the cluster.

func (*MockRegionManager) ScanRegions

func (rm *MockRegionManager) ScanRegions(startKey, endKey []byte, limit int) []*pdclient.Region

func (*MockRegionManager) Split

func (rm *MockRegionManager) Split(regionID, newRegionID uint64, key []byte, peerIDs []uint64, leaderPeerID uint64)

Split splits a Region at the key (encoded) and creates new Region.

func (*MockRegionManager) SplitIndex

func (rm *MockRegionManager) SplitIndex(tableID, indexID int64, count int)

SplitIndex evenly splits the data in index into count regions.

func (*MockRegionManager) SplitKeys

func (rm *MockRegionManager) SplitKeys(start, end kv.Key, count int)

SplitKeys evenly splits the start, end key into "count" regions.

func (*MockRegionManager) SplitRaw

func (rm *MockRegionManager) SplitRaw(regionID, newRegionID uint64, rawKey []byte, peerIDs []uint64, leaderPeerID uint64) *metapb.Region

SplitRaw splits a Region at the key (not encoded) and creates new Region.

func (*MockRegionManager) SplitRegion

func (*MockRegionManager) SplitTable

func (rm *MockRegionManager) SplitTable(tableID int64, count int)

SplitTable evenly splits the data in table into count regions.

type RaftRegionManager

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

func NewRaftRegionManager

func NewRaftRegionManager(store *metapb.Store, router *raftstore.RaftstoreRouter, detector *DetectorServer) *RaftRegionManager

func (*RaftRegionManager) Close

func (rm *RaftRegionManager) Close() error

func (*RaftRegionManager) GetRegionFromCtx

func (rm *RaftRegionManager) GetRegionFromCtx(ctx *kvrpcpb.Context) (*regionCtx, *errorpb.Error)

func (*RaftRegionManager) GetStoreAddrByStoreId

func (rm *RaftRegionManager) GetStoreAddrByStoreId(storeId uint64) (string, error)

func (*RaftRegionManager) GetStoreIDByAddr

func (rm *RaftRegionManager) GetStoreIDByAddr(addr string) (uint64, error)

func (*RaftRegionManager) GetStoreInfoFromCtx

func (rm *RaftRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)

func (*RaftRegionManager) OnPeerApplySnap

func (rm *RaftRegionManager) OnPeerApplySnap(ctx *raftstore.PeerEventContext, region *metapb.Region)

func (*RaftRegionManager) OnPeerCreate

func (rm *RaftRegionManager) OnPeerCreate(ctx *raftstore.PeerEventContext, region *metapb.Region)

func (*RaftRegionManager) OnPeerDestroy

func (rm *RaftRegionManager) OnPeerDestroy(ctx *raftstore.PeerEventContext)

func (*RaftRegionManager) OnRegionConfChange

func (rm *RaftRegionManager) OnRegionConfChange(ctx *raftstore.PeerEventContext, epoch *metapb.RegionEpoch)

func (*RaftRegionManager) OnRoleChange

func (rm *RaftRegionManager) OnRoleChange(regionId uint64, newState raft.StateType)

func (*RaftRegionManager) OnSplitRegion

func (rm *RaftRegionManager) OnSplitRegion(derived *metapb.Region, regions []*metapb.Region, peers []*raftstore.PeerEventContext)

func (*RaftRegionManager) SplitRegion

type RegionError

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

func (*RegionError) Error

func (regionError *RegionError) Error() string

type RegionManager

type RegionManager interface {
	GetRegionFromCtx(ctx *kvrpcpb.Context) (*regionCtx, *errorpb.Error)
	GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)
	SplitRegion(req *kvrpcpb.SplitRegionRequest) *kvrpcpb.SplitRegionResponse
	GetStoreIDByAddr(addr string) (uint64, error)
	GetStoreAddrByStoreId(storeId uint64) (string, error)
	Close() error
}

type RegionOptions

type RegionOptions struct {
	StoreAddr  string
	PDAddr     string
	RegionSize int64
}

type SafePoint

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

func (*SafePoint) CreateCompactionFilter

func (sp *SafePoint) CreateCompactionFilter(targetLevel int, startKey, endKey []byte) badger.CompactionFilter

CreateCompactionFilter implements badger.CompactionFilterFactory function.

func (*SafePoint) UpdateTS

func (sp *SafePoint) UpdateTS(ts uint64)

type SecondaryLocksStatus

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

SecondaryLocksStatus is the result of `CheckSecondaryLocksStatus` API.

type Server

type Server struct {
	RPCClient client.Client
	// contains filtered or unexported fields
}

func NewServer

func NewServer(rm RegionManager, store *MVCCStore, innerServer InnerServer) *Server

func (*Server) BatchCommands

func (svr *Server) BatchCommands(stream tikvpb.Tikv_BatchCommandsServer) error

func (*Server) BatchCoprocessor

func (svr *Server) BatchCoprocessor(req *coprocessor.BatchRequest, batchCopServer tikvpb.Tikv_BatchCoprocessorServer) error

func (*Server) BatchRaft

func (svr *Server) BatchRaft(stream tikvpb.Tikv_BatchRaftServer) error

func (*Server) CancelMPPTask

func (svr *Server) CancelMPPTask(_ context.Context, _ *mpp.CancelTaskRequest) (*mpp.CancelTaskResponse, error)

func (*Server) Coprocessor

func (svr *Server) Coprocessor(_ context.Context, req *coprocessor.Request) (*coprocessor.Response, error)

SQL push down commands.

func (*Server) CoprocessorStream

func (*Server) CreateMPPTaskHandler

func (svr *Server) CreateMPPTaskHandler(meta *mpp.TaskMeta, storeId uint64) (*cophandler.MPPTaskHandler, error)

func (*Server) Detect

func (svr *Server) Detect(stream deadlockPb.Deadlock_DetectServer) error

Detect will handle detection rpc from other nodes

func (*Server) DispatchMPPTask

func (svr *Server) DispatchMPPTask(_ context.Context, _ *mpp.DispatchTaskRequest) (*mpp.DispatchTaskResponse, error)

func (*Server) DispatchMPPTaskWithStoreId

func (svr *Server) DispatchMPPTaskWithStoreId(ctx context.Context, req *mpp.DispatchTaskRequest, storeId uint64) (*mpp.DispatchTaskResponse, error)

func DispatchMPPTask do not have enough information(lack of target store id)

func (*Server) EstablishMPPConnectionWithStoreId

func (svr *Server) EstablishMPPConnectionWithStoreId(req *mpp.EstablishMPPConnectionRequest, server tikvpb.Tikv_EstablishMPPConnectionServer, storeId uint64) error

func EstablishMPPConnection do not have enough information(lack of target store id)

func (*Server) GetMPPTaskHandler

func (svr *Server) GetMPPTaskHandler(taskId int64, storeId uint64) (*cophandler.MPPTaskHandler, error)

func (*Server) GetStoreAddrByStoreId

func (svr *Server) GetStoreAddrByStoreId(storeId uint64) (string, error)

func (*Server) GetStoreIdByAddr

func (svr *Server) GetStoreIdByAddr(addr string) (uint64, error)

func (*Server) GetWaitForEntries

deadlock detection related services GetWaitForEntries tries to get the waitFor entries

func (*Server) KvBatchGet

func (svr *Server) KvBatchGet(ctx context.Context, req *kvrpcpb.BatchGetRequest) (*kvrpcpb.BatchGetResponse, error)

func (*Server) KvBatchRollback

func (*Server) KvCheckTxnStatus

func (*Server) KvCleanup

func (svr *Server) KvCleanup(ctx context.Context, req *kvrpcpb.CleanupRequest) (*kvrpcpb.CleanupResponse, error)

func (*Server) KvCommit

func (svr *Server) KvCommit(ctx context.Context, req *kvrpcpb.CommitRequest) (*kvrpcpb.CommitResponse, error)

func (*Server) KvDeleteRange

func (*Server) KvGC

func (svr *Server) KvGC(ctx context.Context, req *kvrpcpb.GCRequest) (*kvrpcpb.GCResponse, error)

func (*Server) KvGet

func (svr *Server) KvGet(ctx context.Context, req *kvrpcpb.GetRequest) (*kvrpcpb.GetResponse, error)

func (*Server) KvImport

func (*Server) KvPessimisticLock

func (*Server) KvPrewrite

func (svr *Server) KvPrewrite(ctx context.Context, req *kvrpcpb.PrewriteRequest) (*kvrpcpb.PrewriteResponse, error)

func (*Server) KvResolveLock

func (*Server) KvScan

func (svr *Server) KvScan(ctx context.Context, req *kvrpcpb.ScanRequest) (*kvrpcpb.ScanResponse, error)

func (*Server) KvScanLock

func (svr *Server) KvScanLock(ctx context.Context, req *kvrpcpb.ScanLockRequest) (*kvrpcpb.ScanLockResponse, error)

func (*Server) KvTxnHeartBeat

func (*Server) MvccGetByKey

transaction debugger commands.

func (*Server) MvccGetByStartTs

func (*Server) PhysicalScanLock

func (*Server) Raft

func (svr *Server) Raft(stream tikvpb.Tikv_RaftServer) error

Raft commands (tikv <-> tikv).

func (*Server) RawGet

RawKV commands.

func (*Server) RawGetKeyTTL

func (*Server) RawPut

func (*Server) RawScan

func (*Server) RemoveMPPTaskHandler

func (svr *Server) RemoveMPPTaskHandler(taskId int64, storeId uint64) error

func (*Server) Snapshot

func (svr *Server) Snapshot(stream tikvpb.Tikv_SnapshotServer) error

func (*Server) SplitRegion

Region commands.

func (*Server) Stop

func (svr *Server) Stop()

func (*Server) VerGet

func (*Server) VerMut

func (*Server) VerScan

type StandAloneRegionManager

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

func NewStandAloneRegionManager

func NewStandAloneRegionManager(bundle *mvcc.DBBundle, opts RegionOptions, pdc pd.Client) *StandAloneRegionManager

func (*StandAloneRegionManager) Close

func (rm *StandAloneRegionManager) Close() error

func (*StandAloneRegionManager) GetRegionFromCtx

func (rm *StandAloneRegionManager) GetRegionFromCtx(ctx *kvrpcpb.Context) (*regionCtx, *errorpb.Error)

func (*StandAloneRegionManager) GetStoreAddrByStoreId

func (rm *StandAloneRegionManager) GetStoreAddrByStoreId(storeId uint64) (string, error)

func (*StandAloneRegionManager) GetStoreIDByAddr

func (rm *StandAloneRegionManager) GetStoreIDByAddr(addr string) (uint64, error)

func (*StandAloneRegionManager) GetStoreInfoFromCtx

func (rm *StandAloneRegionManager) GetStoreInfoFromCtx(ctx *kvrpcpb.Context) (string, uint64, *errorpb.Error)

func (*StandAloneRegionManager) SplitRegion

type StandAlongInnerServer

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

func NewStandAlongInnerServer

func NewStandAlongInnerServer(bundle *mvcc.DBBundle) *StandAlongInnerServer

func (*StandAlongInnerServer) BatchRaft

func (*StandAlongInnerServer) Raft

func (*StandAlongInnerServer) Setup

func (is *StandAlongInnerServer) Setup(pdClient pd.Client)

func (*StandAlongInnerServer) Snapshot

func (*StandAlongInnerServer) Start

func (is *StandAlongInnerServer) Start(pdClient pd.Client) error

func (*StandAlongInnerServer) Stop

func (is *StandAlongInnerServer) Stop() error

type TxnStatus

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

TxnStatus is the result of `CheckTxnStatus` API.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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