Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,12 @@ private long fetchExistingTotalDocs(String tableName)
String errorMsg =
String.format("Failed when running query: '%s'; got exceptions:\n%s\n", query, response.toPrettyString());
JsonNode exceptions = response.get(EXCEPTIONS);
JsonNode errorCode = exceptions.get(ERROR_CODE);
if (QueryErrorCode.BROKER_INSTANCE_MISSING.getId() == errorCode.asInt()) {
// exceptions is a JSON array; iterate to find any transient error code before failing
JsonNode firstException = exceptions.get(0);
JsonNode errorCode = firstException != null ? firstException.get(ERROR_CODE) : null;
int code = errorCode != null ? errorCode.asInt() : -1;
if (QueryErrorCode.BROKER_INSTANCE_MISSING.getId() == code
|| QueryErrorCode.BROKER_SEGMENT_UNAVAILABLE.getId() == code) {
LOGGER.warn("{}.Trying again", errorMsg);
return 0;
}
Expand Down
Loading