Skip to content

Commit

Permalink
branch-2.1: [fix](report) report queue size based on the number of Be…
Browse files Browse the repository at this point in the history
…s and config #46190 (#46243)

Cherry-picked from #46190

Co-authored-by: deardeng <[email protected]>
  • Loading branch information
github-actions[bot] and deardeng authored Jan 2, 2025
1 parent a52c0e0 commit bfab636
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,13 @@ public TMasterResult handleReport(TReportRequest request) throws TException {

private void putToQueue(ReportTask reportTask) throws Exception {
int currentSize = reportQueue.size();
if (currentSize > Config.report_queue_size) {
LOG.warn("the report queue size exceeds the limit: {}. current: {}", Config.report_queue_size, currentSize);
int maxReportQueueSize = Math.max(Config.report_queue_size,
10 * Env.getCurrentSystemInfo().getAllBackendIds().size());
if (currentSize > maxReportQueueSize) {
LOG.warn("the report queue size exceeds the limit: {}. current: {}", maxReportQueueSize, currentSize);
throw new Exception(
"the report queue size exceeds the limit: "
+ Config.report_queue_size + ". current: " + currentSize);
+ maxReportQueueSize + ". current: " + currentSize);
}

BackendReportType backendReportType = new BackendReportType(reportTask.beId, reportTask.reportType);
Expand Down

0 comments on commit bfab636

Please sign in to comment.