mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
(fb-1903) - Fix SQL Fanout error (#2248)
* added some debug code * added more logging * do sql fanout on dedicated endpoint
This commit is contained in:
parent
87011e4294
commit
3dcc55203f
2 changed files with 2 additions and 3 deletions
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue