From 3dcc55203f54ae18f8858a33e426311a20114ac3 Mon Sep 17 00:00:00 2001 From: Pat Okeeffe <85502298+paddyjok@users.noreply.github.com> Date: Tue, 14 Feb 2023 10:54:15 -0600 Subject: [PATCH] (fb-1903) - Fix SQL Fanout error (#2248) * added some debug code * added more logging * do sql fanout on dedicated endpoint --- http_handler.go | 2 +- sql3/planner/executionplanner.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/http_handler.go b/http_handler.go index c4147ce67..f57f1b666 100644 --- a/http_handler.go +++ b/http_handler.go @@ -549,7 +549,7 @@ func newRouter(handler *Handler) http.Handler { router.HandleFunc("/sql", handler.chkAuthZ(handler.handlePostSQL, authz.Admin)).Methods("POST").Name("PostSQL") } // internal endpoint - router.HandleFunc("/sql", handler.chkAuthZ(handler.handlePostSQLPlanOperator, authz.Admin)).Headers("X-FeatureBase-Plan-Operator", "").Methods("POST").Name("PostSQLPlanOperator") + router.HandleFunc("/sql-exec-graph", handler.chkAuthZ(handler.handlePostSQLPlanOperator, authz.Admin)).Methods("POST").Name("PostSQLPlanOperator") router.HandleFunc("/query-history", handler.chkAuthZ(handler.handleGetPastQueries, authz.Admin)).Methods("GET").Name("GetPastQueries") router.HandleFunc("/version", handler.handleGetVersion).Methods("GET").Name("GetVersion") diff --git a/sql3/planner/executionplanner.go b/sql3/planner/executionplanner.go index 1a86d112a..347e758d3 100644 --- a/sql3/planner/executionplanner.go +++ b/sql3/planner/executionplanner.go @@ -324,7 +324,7 @@ func (e *ExecutionPlanner) remotePlanExec(ctx context.Context, addr string, op t } // Create HTTP request. - u := fmt.Sprintf("%s/sql", addr) + u := fmt.Sprintf("%s/sql-exec-graph", addr) req, err := http.NewRequest("POST", u, bytes.NewReader(b)) if err != nil { return nil, errors.Wrap(err, "creating request") @@ -337,7 +337,6 @@ func (e *ExecutionPlanner) remotePlanExec(ctx context.Context, addr string, op t req.Header.Set("Content-Type", "application/octet-stream") req.Header.Set("Accept", "application/octet-stream") req.Header.Set("User-Agent", "pilosa/"+e.systemAPI.Version()) - req.Header.Set("X-FeatureBase-Plan-Operator", fmt.Sprintf("%T", op)) // Execute request against the host. resp, err := http.DefaultClient.Do(req.WithContext(ctx))