Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterArgs ¶
type FilterArgs struct { Ctx context.Context CmdID storagebase.CmdIDKey Index int Sid roachpb.StoreID Req roachpb.Request Hdr roachpb.Header }
FilterArgs groups the arguments to a ReplicaCommandFilter.
func (*FilterArgs) InRaftCmd ¶
func (f *FilterArgs) InRaftCmd() bool
InRaftCmd returns true if the filter is running in the context of a Raft command (it could be running outside of one, for example for a read).
type ReplayProtectionFilterWrapper ¶
type ReplayProtectionFilterWrapper struct { sync.RWMutex // contains filtered or unexported fields }
ReplayProtectionFilterWrapper wraps a CommandFilter and assures protection from Raft replays.
type ReplicaCommandFilter ¶
type ReplicaCommandFilter func(args FilterArgs) error
ReplicaCommandFilter may be used in tests through the StorageTestingMocker to intercept the handling of commands and artificially generate errors. Return nil to continue with regular processing or non-nil to terminate processing with the returned error. Note that in a multi-replica test this filter will be run once for each replica and must produce consistent results each time.
func WrapFilterForReplayProtection ¶
func WrapFilterForReplayProtection( filter ReplicaCommandFilter) ReplicaCommandFilter
WrapFilterForReplayProtection wraps a filter into another one that adds Raft replay protection.