consistency

package
v0.0.0-...-503c688 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAdminCheckInconsistent returns for data inconsistency for admin check.
	ErrAdminCheckInconsistent = dbterror.ClassAdmin.NewStd(errno.ErrDataInconsistent)
	// ErrLookupInconsistent returns for data inconsistency for index lookup.
	ErrLookupInconsistent = dbterror.ClassExecutor.NewStd(errno.ErrDataInconsistentMismatchCount)
	// ErrAdminCheckInconsistentWithColInfo returns for data inconsistency for admin check but with column info.
	ErrAdminCheckInconsistentWithColInfo = dbterror.ClassExecutor.NewStd(errno.ErrDataInconsistentMismatchIndex)
)

Functions

func DecodeIndexMvccData

func DecodeIndexMvccData(indexInfo *model.IndexInfo) func(kv.Key, *kvrpcpb.MvccGetByKeyResponse, map[string]interface{})

DecodeIndexMvccData creates a closure that captures the indexInfo to be used a decode function in GetMvccByKey.

func DecodeRowMvccData

func DecodeRowMvccData(tableInfo *model.TableInfo) func(kv.Key, *kvrpcpb.MvccGetByKeyResponse, map[string]interface{})

DecodeRowMvccData creates a closure that captures the tableInfo to be used a decode function in GetMvccByKey.

func GetMvccByKey

func GetMvccByKey(tikvStore helper.Storage, key kv.Key, decodeMvccFn func(kv.Key, *kvrpcpb.MvccGetByKeyResponse, map[string]interface{})) string

GetMvccByKey gets the MVCC value by key, and returns a json string including decoded data

Types

type RecordData

type RecordData struct {
	Handle kv.Handle
	Values []types.Datum
}

RecordData is the record data composed of a handle and values.

func (*RecordData) String

func (r *RecordData) String() string

type Reporter

type Reporter struct {
	HandleEncode func(handle kv.Handle) kv.Key
	IndexEncode  func(idxRow *RecordData) kv.Key
	Tbl          *model.TableInfo
	Idx          *model.IndexInfo
	Sctx         sessionctx.Context
}

Reporter is a helper to generate report.

func (*Reporter) ReportAdminCheckInconsistent

func (r *Reporter) ReportAdminCheckInconsistent(ctx context.Context, handle kv.Handle, idxRow, tblRow *RecordData) error

ReportAdminCheckInconsistent reports inconsistent when single index row not found in record rows.

func (*Reporter) ReportAdminCheckInconsistentWithColInfo

func (r *Reporter) ReportAdminCheckInconsistentWithColInfo(ctx context.Context, handle kv.Handle, colName string, idxDat, tblDat fmt.Stringer, err error, idxRow *RecordData) error

ReportAdminCheckInconsistentWithColInfo reports inconsistent when the value of index row is different from record row.

func (*Reporter) ReportLookupInconsistent

func (r *Reporter) ReportLookupInconsistent(ctx context.Context, idxCnt, tblCnt int, missHd, fullHd []kv.Handle, missRowIdx []RecordData) error

ReportLookupInconsistent reports inconsistent when index rows is more than record rows.

Jump to

Keyboard shortcuts

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