Skip to content

Commit

Permalink
kvserver/rangefeed: add newRetryErrBufferCapacityExceeded
Browse files Browse the repository at this point in the history
This patch refactors the error for kvpb.RangeFeedRetryError_REASON_SLOW_CONSUMER
into newRetryErrBufferCapacityExceeded.

Epic: none
Release note: none
  • Loading branch information
wenyihu6 committed Oct 21, 2024
1 parent 55d1d55 commit 510e56b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/kv/kvserver/rangefeed/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ var (
)
)

func newRetryErrBufferCapacityExceeded() error {
return kvpb.NewRangeFeedRetryError(kvpb.RangeFeedRetryError_REASON_SLOW_CONSUMER)
}

// newErrBufferCapacityExceeded creates an error that is returned to subscribers
// if the rangefeed processor is not able to keep up with the flow of incoming
// events and is forced to drop events in order to not block.
func newErrBufferCapacityExceeded() *kvpb.Error {
return kvpb.NewError(
kvpb.NewRangeFeedRetryError(kvpb.RangeFeedRetryError_REASON_SLOW_CONSUMER),
)
return kvpb.NewError(newRetryErrBufferCapacityExceeded())
}

// Config encompasses the configuration required to create a Processor.
Expand Down

0 comments on commit 510e56b

Please sign in to comment.