Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(httpd): abort processing write request when encountering a precision error. #21746

Merged
merged 2 commits into from
Apr 14, 2022
Merged
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
4 changes: 3 additions & 1 deletion services/httpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ func (h *Handler) async(q *influxql.Query, results <-chan *query.Result) {
// bucket2drbp extracts a bucket and retention policy from a properly formatted
// string.
//
// The 2.x compatible endpoints encode the databse and retention policy names
// The 2.x compatible endpoints encode the database and retention policy names
// in the database URL query value. It is encoded using a forward slash like
// "database/retentionpolicy" and we should be able to simply split that string
// on the forward slash.
Expand Down Expand Up @@ -849,6 +849,7 @@ func (h *Handler) serveWriteV2(w http.ResponseWriter, r *http.Request, user meta
default:
err := fmt.Sprintf("invalid precision %q (use ns, us, ms or s)", precision)
h.httpError(w, err, http.StatusBadRequest)
return
}

db, rp, err := bucket2dbrp(r.URL.Query().Get("bucket"))
Expand All @@ -868,6 +869,7 @@ func (h *Handler) serveWriteV1(w http.ResponseWriter, r *http.Request, user meta
default:
err := fmt.Sprintf("invalid precision %q (use n, u, ms, s, m or h)", precision)
h.httpError(w, err, http.StatusBadRequest)
return
}

db := r.URL.Query().Get("db")
Expand Down