deadlock

package
v0.0.0-...-3b3056d Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthDeadlock        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDeadlock          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDeadlock = fmt.Errorf("proto: unexpected end of group")
)
View Source
var DeadlockRequestType_name = map[int32]string{
	0: "Detect",
	1: "CleanUpWaitFor",
	2: "CleanUp",
}
View Source
var DeadlockRequestType_value = map[string]int32{
	"Detect":         0,
	"CleanUpWaitFor": 1,
	"CleanUp":        2,
}

Functions

func RegisterDeadlockServer

func RegisterDeadlockServer(s *grpc.Server, srv DeadlockServer)

Types

type DeadlockClient

type DeadlockClient interface {
	// Get local wait for entries, should be handle by every node.
	// The owner should sent this request to all members to build the complete wait for graph.
	GetWaitForEntries(ctx context.Context, in *WaitForEntriesRequest, opts ...grpc.CallOption) (*WaitForEntriesResponse, error)
	// Detect should only sent to the owner. only be handled by the owner.
	// The DeadlockResponse is sent back only if there is deadlock detected.
	// CleanUpWaitFor and CleanUp doesn't return responses.
	Detect(ctx context.Context, opts ...grpc.CallOption) (Deadlock_DetectClient, error)
}

DeadlockClient is the client API for Deadlock service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewDeadlockClient

func NewDeadlockClient(cc *grpc.ClientConn) DeadlockClient

type DeadlockRequest

type DeadlockRequest struct {
	Tp                   DeadlockRequestType `protobuf:"varint,1,opt,name=tp,proto3,enum=deadlock.DeadlockRequestType" json:"tp,omitempty"`
	Entry                WaitForEntry        `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

func (*DeadlockRequest) Descriptor

func (*DeadlockRequest) Descriptor() ([]byte, []int)

func (*DeadlockRequest) GetEntry

func (m *DeadlockRequest) GetEntry() WaitForEntry

func (*DeadlockRequest) GetTp

func (*DeadlockRequest) Marshal

func (m *DeadlockRequest) Marshal() (dAtA []byte, err error)

func (*DeadlockRequest) MarshalTo

func (m *DeadlockRequest) MarshalTo(dAtA []byte) (int, error)

func (*DeadlockRequest) MarshalToSizedBuffer

func (m *DeadlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeadlockRequest) ProtoMessage

func (*DeadlockRequest) ProtoMessage()

func (*DeadlockRequest) Reset

func (m *DeadlockRequest) Reset()

func (*DeadlockRequest) Size

func (m *DeadlockRequest) Size() (n int)

func (*DeadlockRequest) String

func (m *DeadlockRequest) String() string

func (*DeadlockRequest) Unmarshal

func (m *DeadlockRequest) Unmarshal(dAtA []byte) error

func (*DeadlockRequest) XXX_DiscardUnknown

func (m *DeadlockRequest) XXX_DiscardUnknown()

func (*DeadlockRequest) XXX_Marshal

func (m *DeadlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeadlockRequest) XXX_Merge

func (m *DeadlockRequest) XXX_Merge(src proto.Message)

func (*DeadlockRequest) XXX_Size

func (m *DeadlockRequest) XXX_Size() int

func (*DeadlockRequest) XXX_Unmarshal

func (m *DeadlockRequest) XXX_Unmarshal(b []byte) error

type DeadlockRequestType

type DeadlockRequestType int32
const (
	DeadlockRequestType_Detect DeadlockRequestType = 0
	// CleanUpWaitFor cleans a single entry the transaction is waiting.
	DeadlockRequestType_CleanUpWaitFor DeadlockRequestType = 1
	// CleanUp cleans all entries the transaction is waiting.
	DeadlockRequestType_CleanUp DeadlockRequestType = 2
)

func (DeadlockRequestType) EnumDescriptor

func (DeadlockRequestType) EnumDescriptor() ([]byte, []int)

func (DeadlockRequestType) String

func (x DeadlockRequestType) String() string

type DeadlockResponse

type DeadlockResponse struct {
	// The same entry sent by DeadlockRequest, identifies the sender.
	Entry WaitForEntry `protobuf:"bytes,1,opt,name=entry,proto3" json:"entry"`
	// The key hash of the lock that is hold by the waiting transaction.
	DeadlockKeyHash uint64 `protobuf:"varint,2,opt,name=deadlock_key_hash,json=deadlockKeyHash,proto3" json:"deadlock_key_hash,omitempty"`
	// The other entries of the dead lock circle. The current entry is in `entry` field and  not
	// included in this field.
	WaitChain            []*WaitForEntry `protobuf:"bytes,3,rep,name=wait_chain,json=waitChain,proto3" json:"wait_chain,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*DeadlockResponse) Descriptor

func (*DeadlockResponse) Descriptor() ([]byte, []int)

func (*DeadlockResponse) GetDeadlockKeyHash

func (m *DeadlockResponse) GetDeadlockKeyHash() uint64

func (*DeadlockResponse) GetEntry

func (m *DeadlockResponse) GetEntry() WaitForEntry

func (*DeadlockResponse) GetWaitChain

func (m *DeadlockResponse) GetWaitChain() []*WaitForEntry

func (*DeadlockResponse) Marshal

func (m *DeadlockResponse) Marshal() (dAtA []byte, err error)

func (*DeadlockResponse) MarshalTo

func (m *DeadlockResponse) MarshalTo(dAtA []byte) (int, error)

func (*DeadlockResponse) MarshalToSizedBuffer

func (m *DeadlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DeadlockResponse) ProtoMessage

func (*DeadlockResponse) ProtoMessage()

func (*DeadlockResponse) Reset

func (m *DeadlockResponse) Reset()

func (*DeadlockResponse) Size

func (m *DeadlockResponse) Size() (n int)

func (*DeadlockResponse) String

func (m *DeadlockResponse) String() string

func (*DeadlockResponse) Unmarshal

func (m *DeadlockResponse) Unmarshal(dAtA []byte) error

func (*DeadlockResponse) XXX_DiscardUnknown

func (m *DeadlockResponse) XXX_DiscardUnknown()

func (*DeadlockResponse) XXX_Marshal

func (m *DeadlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DeadlockResponse) XXX_Merge

func (m *DeadlockResponse) XXX_Merge(src proto.Message)

func (*DeadlockResponse) XXX_Size

func (m *DeadlockResponse) XXX_Size() int

func (*DeadlockResponse) XXX_Unmarshal

func (m *DeadlockResponse) XXX_Unmarshal(b []byte) error

type DeadlockServer

type DeadlockServer interface {
	// Get local wait for entries, should be handle by every node.
	// The owner should sent this request to all members to build the complete wait for graph.
	GetWaitForEntries(context.Context, *WaitForEntriesRequest) (*WaitForEntriesResponse, error)
	// Detect should only sent to the owner. only be handled by the owner.
	// The DeadlockResponse is sent back only if there is deadlock detected.
	// CleanUpWaitFor and CleanUp doesn't return responses.
	Detect(Deadlock_DetectServer) error
}

DeadlockServer is the server API for Deadlock service.

type Deadlock_DetectClient

type Deadlock_DetectClient interface {
	Send(*DeadlockRequest) error
	Recv() (*DeadlockResponse, error)
	grpc.ClientStream
}

type Deadlock_DetectServer

type Deadlock_DetectServer interface {
	Send(*DeadlockResponse) error
	Recv() (*DeadlockRequest, error)
	grpc.ServerStream
}

type UnimplementedDeadlockServer

type UnimplementedDeadlockServer struct {
}

UnimplementedDeadlockServer can be embedded to have forward compatible implementations.

func (*UnimplementedDeadlockServer) Detect

func (*UnimplementedDeadlockServer) GetWaitForEntries

type WaitForEntriesRequest

type WaitForEntriesRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WaitForEntriesRequest) Descriptor

func (*WaitForEntriesRequest) Descriptor() ([]byte, []int)

func (*WaitForEntriesRequest) Marshal

func (m *WaitForEntriesRequest) Marshal() (dAtA []byte, err error)

func (*WaitForEntriesRequest) MarshalTo

func (m *WaitForEntriesRequest) MarshalTo(dAtA []byte) (int, error)

func (*WaitForEntriesRequest) MarshalToSizedBuffer

func (m *WaitForEntriesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WaitForEntriesRequest) ProtoMessage

func (*WaitForEntriesRequest) ProtoMessage()

func (*WaitForEntriesRequest) Reset

func (m *WaitForEntriesRequest) Reset()

func (*WaitForEntriesRequest) Size

func (m *WaitForEntriesRequest) Size() (n int)

func (*WaitForEntriesRequest) String

func (m *WaitForEntriesRequest) String() string

func (*WaitForEntriesRequest) Unmarshal

func (m *WaitForEntriesRequest) Unmarshal(dAtA []byte) error

func (*WaitForEntriesRequest) XXX_DiscardUnknown

func (m *WaitForEntriesRequest) XXX_DiscardUnknown()

func (*WaitForEntriesRequest) XXX_Marshal

func (m *WaitForEntriesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WaitForEntriesRequest) XXX_Merge

func (m *WaitForEntriesRequest) XXX_Merge(src proto.Message)

func (*WaitForEntriesRequest) XXX_Size

func (m *WaitForEntriesRequest) XXX_Size() int

func (*WaitForEntriesRequest) XXX_Unmarshal

func (m *WaitForEntriesRequest) XXX_Unmarshal(b []byte) error

type WaitForEntriesResponse

type WaitForEntriesResponse struct {
	Entries              []WaitForEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

func (*WaitForEntriesResponse) Descriptor

func (*WaitForEntriesResponse) Descriptor() ([]byte, []int)

func (*WaitForEntriesResponse) GetEntries

func (m *WaitForEntriesResponse) GetEntries() []WaitForEntry

func (*WaitForEntriesResponse) Marshal

func (m *WaitForEntriesResponse) Marshal() (dAtA []byte, err error)

func (*WaitForEntriesResponse) MarshalTo

func (m *WaitForEntriesResponse) MarshalTo(dAtA []byte) (int, error)

func (*WaitForEntriesResponse) MarshalToSizedBuffer

func (m *WaitForEntriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WaitForEntriesResponse) ProtoMessage

func (*WaitForEntriesResponse) ProtoMessage()

func (*WaitForEntriesResponse) Reset

func (m *WaitForEntriesResponse) Reset()

func (*WaitForEntriesResponse) Size

func (m *WaitForEntriesResponse) Size() (n int)

func (*WaitForEntriesResponse) String

func (m *WaitForEntriesResponse) String() string

func (*WaitForEntriesResponse) Unmarshal

func (m *WaitForEntriesResponse) Unmarshal(dAtA []byte) error

func (*WaitForEntriesResponse) XXX_DiscardUnknown

func (m *WaitForEntriesResponse) XXX_DiscardUnknown()

func (*WaitForEntriesResponse) XXX_Marshal

func (m *WaitForEntriesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WaitForEntriesResponse) XXX_Merge

func (m *WaitForEntriesResponse) XXX_Merge(src proto.Message)

func (*WaitForEntriesResponse) XXX_Size

func (m *WaitForEntriesResponse) XXX_Size() int

func (*WaitForEntriesResponse) XXX_Unmarshal

func (m *WaitForEntriesResponse) XXX_Unmarshal(b []byte) error

type WaitForEntry

type WaitForEntry struct {
	// The transaction id that is waiting.
	Txn uint64 `protobuf:"varint,1,opt,name=txn,proto3" json:"txn,omitempty"`
	// The transaction id that is being waited for.
	WaitForTxn uint64 `protobuf:"varint,2,opt,name=wait_for_txn,json=waitForTxn,proto3" json:"wait_for_txn,omitempty"`
	// The hash value of the key is being waited for.
	KeyHash uint64 `protobuf:"varint,3,opt,name=key_hash,json=keyHash,proto3" json:"key_hash,omitempty"`
	// The key the current txn is trying to lock.
	Key []byte `protobuf:"bytes,4,opt,name=key,proto3" json:"key,omitempty"`
	// The tag came from the lock request's context.
	ResourceGroupTag []byte `protobuf:"bytes,5,opt,name=resource_group_tag,json=resourceGroupTag,proto3" json:"resource_group_tag,omitempty"`
	// Milliseconds it has been waits.
	WaitTime             uint64   `protobuf:"varint,6,opt,name=wait_time,json=waitTime,proto3" json:"wait_time,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*WaitForEntry) Descriptor

func (*WaitForEntry) Descriptor() ([]byte, []int)

func (*WaitForEntry) GetKey

func (m *WaitForEntry) GetKey() []byte

func (*WaitForEntry) GetKeyHash

func (m *WaitForEntry) GetKeyHash() uint64

func (*WaitForEntry) GetResourceGroupTag

func (m *WaitForEntry) GetResourceGroupTag() []byte

func (*WaitForEntry) GetTxn

func (m *WaitForEntry) GetTxn() uint64

func (*WaitForEntry) GetWaitForTxn

func (m *WaitForEntry) GetWaitForTxn() uint64

func (*WaitForEntry) GetWaitTime

func (m *WaitForEntry) GetWaitTime() uint64

func (*WaitForEntry) Marshal

func (m *WaitForEntry) Marshal() (dAtA []byte, err error)

func (*WaitForEntry) MarshalTo

func (m *WaitForEntry) MarshalTo(dAtA []byte) (int, error)

func (*WaitForEntry) MarshalToSizedBuffer

func (m *WaitForEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*WaitForEntry) ProtoMessage

func (*WaitForEntry) ProtoMessage()

func (*WaitForEntry) Reset

func (m *WaitForEntry) Reset()

func (*WaitForEntry) Size

func (m *WaitForEntry) Size() (n int)

func (*WaitForEntry) String

func (m *WaitForEntry) String() string

func (*WaitForEntry) Unmarshal

func (m *WaitForEntry) Unmarshal(dAtA []byte) error

func (*WaitForEntry) XXX_DiscardUnknown

func (m *WaitForEntry) XXX_DiscardUnknown()

func (*WaitForEntry) XXX_Marshal

func (m *WaitForEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*WaitForEntry) XXX_Merge

func (m *WaitForEntry) XXX_Merge(src proto.Message)

func (*WaitForEntry) XXX_Size

func (m *WaitForEntry) XXX_Size() int

func (*WaitForEntry) XXX_Unmarshal

func (m *WaitForEntry) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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