Skip to content

Commit 9e59e52

Browse files
kyle-a-wongdhartunian
authored andcommitted
server,ui: increase max result size for sql over http requests
The default for max result size for the sql over http v2 API was previously set to 10kb, which was frequently resulting in incomplete results / error messages in db console. Additionally, db console used 50kb to as the "LARGE_RESULT_SIZE" value for many of db consoles sql over http requests. This has also been seen to result in errors like "Not all insights are displayed because the maximum number of insights was reached in the console." in the db console insights page. This change increases the default on the server side from 10kb to 100kb and the value of "LARGE_RESULT_SIZE" from 50kb to 1Mb Resolves: #146875 Epic: None Release note: None
1 parent 7ca9db8 commit 9e59e52

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

pkg/ccl/serverccl/testdata/api_v2_sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sql admin
1212
"application_name": "$ api-v2-sql",
1313
"database": "system",
1414
"execute": false,
15-
"max_result_size": 10000,
15+
"max_result_size": 100000,
1616
"separate_txns": false,
1717
"statements": [
1818
{

pkg/server/api_v2_sql.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ func (a *apiV2Server) execSQL(w http.ResponseWriter, r *http.Request) {
306306
return
307307
}
308308
if requestPayload.MaxResultSize == 0 {
309-
requestPayload.MaxResultSize = 10000
309+
// Default to 100 kb if no MaxResultSize is provided.
310+
requestPayload.MaxResultSize = 100_000
310311
}
311312
if len(requestPayload.Statements) == 0 {
312313
topLevelError(errors.New("no statements specified"), http.StatusBadRequest)

pkg/server/testdata/api_v2_sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sql admin
1010
"application_name": "$ api-v2-sql",
1111
"database": "system",
1212
"execute": false,
13-
"max_result_size": 10000,
13+
"max_result_size": 100000,
1414
"separate_txns": false,
1515
"statements": [
1616
{

pkg/ui/workspaces/cluster-ui/src/api/schedulesApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { RequestError } from "../util";
1010

1111
import {
1212
executeInternalSql,
13-
MAX_RESULT_SIZE,
13+
LARGE_RESULT_SIZE,
1414
SqlExecutionRequest,
1515
sqlResultsAreEmpty,
1616
} from "./sqlApi";
@@ -74,7 +74,7 @@ export function getSchedules(req: {
7474
arguments: args,
7575
},
7676
],
77-
max_result_size: MAX_RESULT_SIZE,
77+
max_result_size: LARGE_RESULT_SIZE,
7878
execute: true,
7979
};
8080
return executeInternalSql<ScheduleColumns>(request).then(result => {

pkg/ui/workspaces/cluster-ui/src/api/sqlApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function executeSql<RowType>(
9090

9191
export const INTERNAL_SQL_API_APP = "$ internal-console";
9292
export const LONG_TIMEOUT = "300s";
93-
export const LARGE_RESULT_SIZE = 50000; // 50 kib
93+
export const LARGE_RESULT_SIZE = 1_000_000; // 1 Mb
9494
export const MAX_RESULT_SIZE = 2_147_483_647; // Max result size is max int32, which is 2Gib
9595
export const FALLBACK_DB = "system";
9696

0 commit comments

Comments
 (0)