Documentation
¶
Index ¶
- func AttachRPCContext(err error, info *viewpb.RPCRequestContext) error
- func ConvertViewError(method string, err error) error
- func NewGRPCStatusFromError(err error) *status.Status
- func NewGRPCStatusFromViewError(e *ViewError) *status.Status
- func RPCContextFromDetails(details []any) *viewpb.RPCRequestContext
- type NodeSessionUnavailable
- type ViewClientStatus
- type ViewCode
- type ViewError
- func AsViewError(err error) *ViewError
- func New(code viewpb.ViewCode, format string, args ...interface{}) *ViewError
- func NewNotPrimaryError(format string, args ...interface{}) *ViewError
- func NewOnShutdownError(format string, args ...interface{}) *ViewError
- func NewUnknownError(format string, args ...interface{}) *ViewError
- func NewViewInvalidated(format string, args ...interface{}) *ViewError
- func NewViewNotFound(format string, args ...interface{}) *ViewError
- type ViewErrorInner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachRPCContext ¶
func AttachRPCContext(err error, info *viewpb.RPCRequestContext) error
AttachRPCContext adds structured gRPC details without replacing the original error chain: readiness, session discovery and cancellation still inspect it. WithDetails serializes a snapshot, so later changes to info cannot affect err.
func ConvertViewError ¶
ConvertViewError converts error to ViewClientStatus. Used in client side.
func NewGRPCStatusFromError ¶
NewGRPCStatusFromError preserves business error codes as native gRPC details. View lifecycle errors keep their retry protocol. For business errors, common.Status carries the code/classification and ViewError carries the cause rendered by ViewClientStatus.Error.
func NewGRPCStatusFromViewError ¶
NewGRPCStatusFromViewError converts ViewError to grpc status. Should be called at server-side.
func RPCContextFromDetails ¶
func RPCContextFromDetails(details []any) *viewpb.RPCRequestContext
RPCContextFromDetails uses the last matching detail: the local client's actual target takes precedence over context supplied by a remote peer.
Types ¶
type NodeSessionUnavailable ¶
type NodeSessionUnavailable struct {
}
NodeSessionUnavailable is client-local metadata, never a wire error. Changed belongs to the QN session watch captured before dispatch, so a resolver update racing with an RPC failure cannot be missed. Unwrap preserves the RPC cause.
func (*NodeSessionUnavailable) Error ¶
func (e *NodeSessionUnavailable) Error() string
func (*NodeSessionUnavailable) Unwrap ¶
func (e *NodeSessionUnavailable) Unwrap() error
type ViewClientStatus ¶
ViewClientStatus is a wrapper of grpc status. Should be used in client side.
func (*ViewClientStatus) GRPCStatus ¶
func (s *ViewClientStatus) GRPCStatus() *status.Status
GRPCStatus returns the underlying gRPC status.
func (*ViewClientStatus) TryIntoViewError ¶
func (s *ViewClientStatus) TryIntoViewError() *ViewError
TryIntoViewError tries to extract a ViewError from the gRPC status details.
func (*ViewClientStatus) Unwrap ¶
func (s *ViewClientStatus) Unwrap() error
Unwrap exposes the original Milvus code to the Proxy's public status mapping without discarding the view protocol used by query retries.
type ViewCode ¶
ViewError is the error type for view-related operations. Should be used at logic layer.
type ViewError ¶
type ViewError ViewErrorInner
ViewError is the error type for view-related operations. Should be used at logic layer.
func AsViewError ¶
AsViewError converts an error to a ViewError. If the error is already a ViewError, returns it directly. Otherwise wraps it as VIEW_CODE_UNKNOWN.
func NewNotPrimaryError ¶
NewNotPrimaryError creates a ViewError with VIEW_CODE_NOT_PRIMARY.
func NewOnShutdownError ¶
NewOnShutdownError creates a ViewError with VIEW_CODE_ON_SHUTDOWN.
func NewUnknownError ¶
NewUnknownError creates a ViewError with VIEW_CODE_UNKNOWN.
func NewViewInvalidated ¶
NewViewInvalidated creates a ViewError with VIEW_CODE_VIEW_INVALIDATED.
func NewViewNotFound ¶
NewViewNotFound creates a ViewError with VIEW_CODE_VIEW_NOT_FOUND.
func (*ViewError) IsNotPrimary ¶
IsNotPrimary returns true if the node is not the primary replica for this shard.
func (*ViewError) IsOnShutdown ¶
IsOnShutdown returns true if the node is shutting down.
func (*ViewError) IsRetryable ¶
IsRetryable returns true if the error should trigger a retry from Phase 1.
func (*ViewError) IsViewInvalidated ¶
IsViewInvalidated returns true if the view version is no longer valid.
func (*ViewError) IsViewNotFound ¶
IsViewNotFound returns true if the view version was not found on the node.
type ViewErrorInner ¶
ViewErrorInner is the underlying type aliased from proto.