rafterrors

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

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

Go to latest
Published: May 5, 2023 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package rafterrors annotates Raft errors with gRPC status codes.

Use MarkRetriable/MarkUnretriable to add a gRPC status code.

Use MarkRetriable for atomic operations like Apply, ApplyLog, Barrier, changing configuration/voters.

Use MarkUnretriable if your own application already made changes that it didn't roll back and for Restore. Restore does multiple operation, and errors could be from the first or second and it's unsafe to distinguish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarkRetriable

func MarkRetriable(err error) error

MarkRetriable annotates a Raft error with a gRPC status code, given that the entire operation is retriable.

func MarkUnretriable

func MarkUnretriable(err error) error

MarkUnretriable annotates a Raft error with a gRPC status code, given that the entire operation is not retriable.

func RetriableCode

func RetriableCode(err error) codes.Code

RetriableCode returns a gRPC status code for a given Raft error, given that the entire operation is retriable.

func UnretriableCode

func UnretriableCode(err error) codes.Code

Code returns a gRPC status code for a given Raft error, given that the entire operation is not retriable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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