Skip to content

feat: add QuestDB QWP ingress/egress and InfluxDB 3 support - #29

Merged
javier merged 6 commits into
masterfrom
feature/qwip-qwep-influxv3
Sep 4, 2026
Merged

javier merged 6 commits into
masterfrom
feature/qwip-qwep-influxv3

Conversation

@sklarsa

@sklarsa sklarsa commented Sep 2, 2026 •

Copy link
Copy Markdown

Summary

  • add QuestDB QWP ingress, QWP egress, and the native questdb-qwp data format
  • add explicit transport completion handling while preserving ILP and PGWire defaults
  • add InfluxDB 3 loading/query support and fully consume and release Arrow Flight results
  • harden QWP shutdown, binary decoding, SQL placeholder rewriting, and batch buffer ownership

Compatibility and provenance

The public QuestDB protocol selector is consistently qwp for both ingestion and queries. The pre-merge internal spellings qwip and qwep are intentionally rejected.

questdb/benchmark-runner currently pins the earlier branch commit 0484fec39ad2620873921ac472712db9aab72383. It will be updated in a separate PR to the merged TSBS revision only after this PR lands.

The latest tagged github.com/questdb/go-questdb-client/v4 release, v4.2.0, is six commits behind the required QWP APIs. This PR therefore keeps the exact pseudo-version at commit 4f2723e2d5cb5a9beea62dce16f932e56ee30e78; it should move to the first suitable tagged release before benchmark results are published.

Review hardening

  • prevent sender configuration errors from disclosing credentials
  • bound final QWP acknowledgement and sender close with one deadline
  • bound per-record and cumulative native decoder allocations
  • reject non-canonical native row payloads
  • use qwp consistently for QWP ingress and egress
  • rewrite only executable SQL bind placeholders and escape inlined apostrophes
  • capture decoder ownership in each QWP batch factory
  • eliminate sync.Pool slice-header boxing

Verification

  • GOTOOLCHAIN=go1.23.12 GO111MODULE=on go test -race ./...
  • GOTOOLCHAIN=go1.23.12 GO111MODULE=on go vet ./cmd/tsbs_load_questdb ./cmd/tsbs_run_queries_questdb
  • GOTOOLCHAIN=go1.23.12 GO111MODULE=on go build ./...
  • GOTOOLCHAIN=go1.23.12 GO111MODULE=on go mod verify
  • GOTOOLCHAIN=go1.23.12 GO111MODULE=on go run honnef.co/go/tools/cmd/staticcheck@v0.6.1 -checks=SA6002 ./cmd/tsbs_load_questdb
  • git diff --check cb805908b15642321132c61829da8cfe16c6a8a4..9d184d6edc227093f8349b070fd6842a804cfbcd

Repository-wide go vet ./... retains three findings already present on master; both changed QuestDB command packages pass vet.

@sklarsa
sklarsa marked this pull request as ready for review September 2, 2026 17:43
@sklarsa
sklarsa requested a review from javier September 2, 2026 17:44

@javier javier left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran tsbs vs questdb QWP and influx 3 and it all worked fine. Claude has a few comments. I think the qwip/qwep naming should be unified to qwp. We only use QWP in our public facing docs and qwip/qwep had been used only internally. Our docs just say QWP and when they want to make a difference they say QWP Ingress/QWP Egress.

The rest of comments are nice to have

1. Latent placeholder bug. inlineArrayParams (cmd/tsbs_run_queries_questdb/sql.go:78) renumbers with strings.ReplaceAll("$2" → "$1"). At 10+ params a $20 becomes $10.
  Unreachable today (max ~3 params) but a trap. Same function inlines array items as fmt.Sprintf("'%v'", item) with no quote escaping — fine for host_N, breaks on any value with
  an apostrophe.
  2. Stale PR body. It says the branch is "the exact TSBS commit pinned by questdb/benchmark-runner: 0484fec". HEAD is 353ffd0, two commits later. Anyone verifying against 0484fec
  checks the wrong tree.
  3. Pre-release client pin. go-questdb-client/v4 v4.2.1-0.20260730155217-4f2723e2d5cb is a pseudo-version on an untagged commit. Reproducible, but worth confirming a tagged
  release lands before published benchmark numbers depend on it.
  4. Naming is genuinely confusing. --protocol=qwip but --query-protocol=qwep, with --qwp-addr serving both, the format called questdb-qwp, and the body saying QWIP/QWEP. Three
  spellings across one feature — at minimum worth a docs callout.
  5. Two small ones: qwpBatch.Append reads the package global qwpDec rather than a batch-held reference (safe today, commented, but coupled); and qwpBufPool stores []byte rather
  than *[]byte, so every Put boxes an allocation in a hot path — staticcheck SA6002 would flag it, go vet doesn't.

@sklarsa sklarsa changed the title feat: add QuestDB QWIP/QWEP and InfluxDB 3 support feat: add QuestDB QWP ingress/egress and InfluxDB 3 support Sep 4, 2026
@sklarsa

sklarsa commented Sep 4, 2026

Copy link
Copy Markdown
Author

@javier Addressed review 5112672724 in 9d184d6:

  • unified the public selector as qwp for both QWP ingress and QWP egress; qwip/qwep are now rejected
  • replaced textual placeholder renumbering with a SQL-context-aware scanner that preserves literals, quoted identifiers, nested block comments, line comments, and dollar-quoted bodies
  • escaped apostrophes in inlined array values and added $2/$20 plus lexical-context regressions
  • made each QWP batch use the decoder captured by its factory instead of package-global qwpDec
  • changed the batch buffer pool to store *[]byte; the allocation regression and staticcheck SA6002 pass
  • corrected the PR title/body and current-head provenance

There is no suitable tagged Go client release yet: v4.2.0 is six commits behind the required QWP APIs. The exact pseudo-version remains pinned, and the docs now require moving to the first suitable tag before publishing benchmark results.

Verification completed:

  • full go test -race ./...
  • affected-package go vet
  • full go build ./...
  • go mod verify
  • staticcheck SA6002
  • GitHub build and gitleaks checks

Please re-review when convenient.

@javier
javier merged commit b12abbe into master Sep 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants