Skip to content

Commit

Permalink
[router] Do not classify REQUEST_ENTITY_TOO_LARGE as unhealthy (#1292)
Browse files Browse the repository at this point in the history
* [router] Do not classify REQUEST_ENTITY_TOO_LARGE as unhealthy

---------

Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 and Sourav Maji authored Nov 8, 2024
1 parent 90dd662 commit 878304f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ public void testRead() throws Exception {
storeClient.batchGet(keySet).get();
fail("Should receive exception since the batch request key count exceeds cluster-level threshold");
} catch (Exception e) {
double unhealthyRequestCount = getAggregateRouterMetricValue(".total--multiget_unhealthy_request.Count");
Assert.assertEquals(unhealthyRequestCount, 0.0, "There should not be any unhealthy requests!");
LOGGER.info(e);
}
// Bump up store-level max key count in batch-get request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private static void metricTracking(
ROUTER_STATS.getStatsByType(requestType.isPresent() ? requestType.get() : RequestType.SINGLE_GET);
// If we don't know the actual store name, this error will only be aggregated in server level, but not
// in store level
if (responseStatus.equals(BAD_REQUEST)) {
if (responseStatus.equals(BAD_REQUEST) || responseStatus.equals(REQUEST_ENTITY_TOO_LARGE)) {
stats.recordBadRequest(storeName.orElse(null));
} else if (responseStatus.equals(TOO_MANY_REQUESTS)) {
if (storeName.isPresent()) {
Expand Down

0 comments on commit 878304f

Please sign in to comment.