Skip to content

Commit

Permalink
Also rename the IngestFailureReason proto naming
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Jan 29, 2025
1 parent c28f6a3 commit 2a9da60
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 127 deletions.
2 changes: 1 addition & 1 deletion quickwit/quickwit-ingest/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl From<IngestFailure> for IngestServiceError {
IngestFailureReason::NoShardsAvailable => {
IngestServiceError::Unavailable("no shards available".to_string())
}
IngestFailureReason::ShardRateLimited => {
IngestFailureReason::AttemptedShardsRateLimited => {
IngestServiceError::RateLimited(RateLimitingCause::AttemptedShardsRateLimited)
}
IngestFailureReason::AllShardsRateLimited => {
Expand Down
4 changes: 2 additions & 2 deletions quickwit/quickwit-ingest/src/ingest_v2/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ fn update_ingest_metrics(ingest_result: &IngestV2Result<IngestResponseV2>, num_s
IngestFailureReason::NoShardsAvailable => {
ingest_results_metrics.no_shards_available.inc()
}
IngestFailureReason::ShardRateLimited => {
IngestFailureReason::AttemptedShardsRateLimited => {
ingest_results_metrics.attempted_shards_rate_limited.inc()
}
IngestFailureReason::AllShardsRateLimited => {
Expand Down Expand Up @@ -2171,7 +2171,7 @@ mod tests {
assert_eq!(ingest_response.failures.len(), 1);
assert_eq!(
ingest_response.failures[0].reason(),
IngestFailureReason::ShardRateLimited
IngestFailureReason::AttemptedShardsRateLimited
);
}
}
2 changes: 1 addition & 1 deletion quickwit/quickwit-ingest/src/ingest_v2/workbench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl SubworkbenchFailure {
RateLimitingCause::WalFull => IngestFailureReason::WalFull,
RateLimitingCause::CircuitBreaker => IngestFailureReason::CircuitBreaker,
RateLimitingCause::AttemptedShardsRateLimited => {
IngestFailureReason::ShardRateLimited
IngestFailureReason::AttemptedShardsRateLimited
}
RateLimitingCause::AllShardsRateLimited => {
IngestFailureReason::AllShardsRateLimited
Expand Down
4 changes: 1 addition & 3 deletions quickwit/quickwit-proto/protos/quickwit/router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ enum IngestFailureReason {
INGEST_FAILURE_REASON_SOURCE_NOT_FOUND = 2;
INGEST_FAILURE_REASON_INTERNAL = 3;
INGEST_FAILURE_REASON_NO_SHARDS_AVAILABLE = 4;
// the shards we tried to write to are rate limited
INGEST_FAILURE_REASON_SHARD_RATE_LIMITED = 5;
INGEST_FAILURE_REASON_ATTEMPTED_SHARDS_RATE_LIMITED = 5;
INGEST_FAILURE_REASON_WAL_FULL = 6;
INGEST_FAILURE_REASON_TIMEOUT = 7;
INGEST_FAILURE_REASON_ROUTER_LOAD_SHEDDING = 8;
INGEST_FAILURE_REASON_LOAD_SHEDDING = 9;
INGEST_FAILURE_REASON_CIRCUIT_BREAKER = 10;
// all the known open shards are rate limited
INGEST_FAILURE_REASON_ALL_SHARDS_RATE_LIMITED = 11;
}

Expand Down
Loading

0 comments on commit 2a9da60

Please sign in to comment.