Skip to content

fix: empty query during failed transaction with parser off - #2009

Merged
levkk merged 2 commits into
mainfrom
levkk-parser-off-empty-query
Nov 10, 2026
Merged

levkk merged 2 commits into
mainfrom
levkk-parser-off-empty-query

Conversation

@levkk

@levkk levkk commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

Regression in 1fbfe49 (#1659), which I thought was fixed in 15482db (#1945) didn't cover deployments that turn off query parsing.

Solution

If the parser is off, forward request as-is to Postgres and let it reject/accept the query.

@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@levkk
levkk merged commit 24dbfb6 into main Nov 10, 2026
48 of 50 checks passed
@levkk
levkk deleted the levkk-parser-off-empty-query branch November 10, 2026 23:10
@github-actions

Copy link
Copy Markdown
Contributor

Metal bench (arm64) passed. All 517 measures within bounds.

suite throughput cpu/txn user cycles/txn user instr/txn kernel cycles/txn kernel instr/txn ctx/txn
pooler 18.99 (-0.3% ± 0.8%) 18,639 (-0.5% ± 1.1%) 32,034 (+0.0% ± 0.08%) 29,866 (-0.2% ± 1.3%) 51,112 (+0.3% ± 0.5%)
lb 19.8 (+0.0% ± 0.6%) 19,383 (+0.1% ± 0.4%) 32,925 (-0.0% ± 0.06%) 31,018 (+0.0% ± 0.9%) 52,059 (-0.3% ± 0.3%)
sharding-w2 31.32 (-0.1% ± 1.5%) 42,948 (+0.3% ± 0.8%) 97,439 (-0.0% ± 0.01%) 38,121 (-0.7% ± 4.0%) 53,652 (-0.0% ± 0.2%) 1.552 (-0.0% ± 0.5%)
sharding-w8 252,480 (+0.2% ± 1.3%) 28.21 (-0.2% ± 1.5%) 43,312 (-0.2% ± 1.2%) 52,946 (-0.0% ± 0.03%) 34,569 (-0.3% ± 3.3%) 42,370 (-0.0% ± 0.05%) 0.1744 (+0.6% ± 1.6%)
Counters per txn
suite frontend stall l1i refill backend stall
pooler 8,005 (-1.4% ± 2.7%) 2,667 (-0.9% ± 1.0%)
lb 8,522 (+0.4% ± 1.1%) 2,750 (-0.1% ± 0.6%)
sharding-w2 16,453 (+1.0% ± 2.7%) 3,930 (+0.5% ± 1.8%)
sharding-w8 18,024 (+0.3% ± 3.0%) 3,783 (+0.3% ± 1.1%)

Microbench: all 504 measures within bounds.

Hot code per txn
path base head change
pooler 111.5 KB 110.7 KB -0.8 KB
sharding-w2 165.0 KB 164.6 KB -0.4 KB

pooler:

crate base head change
pgdog::frontend::client::query_engine 19.9 KB 19.6 KB -0.3 KB
tokio 18.4 KB 18.5 KB +0.1 KB
pgdog::backend::pool 17.5 KB 17.5 KB +0.0 KB
aws-lc (TLS crypto) 10.3 KB 9.9 KB -0.4 KB
rustls (TLS) 8.3 KB 8.4 KB +0.1 KB
pgdog::frontend (other) 7.9 KB 7.8 KB -0.1 KB
pgdog::backend::server 7.1 KB 7.2 KB +0.2 KB
other 6.3 KB 6.3 KB +0.0 KB
everything else 15.8 KB 15.5 KB -0.2 KB
function head change
pgdog::frontend::client::Client::run::{{closure}} 5.4 KB -0.1 KB
pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine: 5.2 KB -0.2 KB
pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}} 4.0 KB -0.1 KB
tokio::runtime::task::raw::poll 3.1 KB -0.1 KB
pgdog::backend::server::Server::read::{{closure}} 2.9 KB +0.1 KB

sharding-w2:

crate base head change
pgdog::frontend::router 28.6 KB 28.9 KB +0.2 KB
pgdog::frontend::client::query_engine 20.7 KB 21.1 KB +0.4 KB
tokio 18.6 KB 18.8 KB +0.1 KB
pgdog::backend::pool 18.3 KB 18.1 KB -0.2 KB
aws-lc (TLS crypto) 12.8 KB 12.6 KB -0.2 KB
other 10.0 KB 9.8 KB -0.2 KB
pgdog::frontend (other) 8.6 KB 8.6 KB +0.0 KB
rustls (TLS) 8.1 KB 8.1 KB -0.1 KB
everything else 39.2 KB 38.7 KB -0.6 KB
function head change
pgdog::frontend::client::Client::run::{{closure}} 6.1 KB +0.1 KB
pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine: 5.4 KB +0.1 KB
pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}} 4.1 KB +0.1 KB
pgdog::frontend::router::parser::query::select::<impl pgdog::frontend::router::parser::que 3.4 KB +0.1 KB
tokio::runtime::task::raw::poll 3.2 KB -0.1 KB
lb flamegraph vs b44e013

lb

Open interactive for hover, zoom and search.

lb removed

Open interactive.

microbench flamegraph vs b44e013

microbench

Open interactive for hover, zoom and search.

microbench removed

Open interactive.

pooler flamegraph vs b44e013

pooler

Open interactive for hover, zoom and search.

pooler removed

Open interactive.

sharding-w2 flamegraph vs b44e013

sharding-w2

Open interactive for hover, zoom and search.

sharding-w2 removed

Open interactive.

sharding-w8 flamegraph vs b44e013

sharding-w8

Open interactive for hover, zoom and search.

sharding-w8 removed

Open interactive.

Logs

lb, microbench, pooler, sharding-w2, sharding-w8, verdict.json

Compared 31e5d9d with b44e013 on m8g.metal-24xl (spot).

@github-actions

Copy link
Copy Markdown
Contributor

Metal bench (x86) passed. All 517 measures within bounds.

suite throughput cpu/txn user cycles/txn user instr/txn kernel cycles/txn kernel instr/txn ctx/txn
pooler 35.03 (-0.0% ± 0.6%) 23,797 (+0.1% ± 0.9%) 33,976 (+0.0% ± 0.02%) 57,835 (-0.1% ± 0.7%) 38,454 (-0.0% ± 0.3%)
lb 36 (-0.1% ± 0.2%) 24,852 (-0.4% ± 0.4%) 34,930 (+0.0% ± 0.01%) 58,724 (-0.1% ± 0.3%) 39,156 (+0.1% ± 0.2%)
sharding-w2 57 (+0.2% ± 1.0%) 54,500 (+0.4% ± 1.4%) 101,370 (-0.0% ± 0.03%) 72,966 (+0.2% ± 1.2%) 43,058 (-0.0% ± 0.4%) 1.39 (-0.1% ± 0.3%)
sharding-w8 148,612 (+0.3% ± 0.8%) 48.21 (+0.1% ± 1.0%) 58,562 (+0.2% ± 1.5%) 56,834 (+0.0% ± 0.2%) 63,835 (+0.0% ± 0.9%) 34,160 (-0.1% ± 0.1%) 0.1676 (+0.0% ± 0.7%)
Counters per txn
suite frontend stall l1i refill backend stall
pooler 80,201 (+0.4% ± 1.0%) 3,777 (+0.2% ± 0.2%)
lb 83,455 (-0.2% ± 0.5%) 3,900 (+0.2% ± 0.2%)
sharding-w2 165,992 (+0.8% ± 1.9%) 6,220 (+0.7% ± 0.6%)
sharding-w8 124,221 (-0.2% ± 2.3%) 4,935 (+0.3% ± 0.7%)

Microbench: all 504 measures within bounds.

Microbench latency: 9 benches changed more than 3%
benchmark latency baseline change instructions change
simple_cold::update_all_shards 3,449 ns 3,591 ns -3.95% ± 0.83% +0.00% ± 0.00%
extended_cold::update_by_key 4,486 ns 4,664 ns -3.82% ± 0.56% +0.00% ± 0.00%
extended_evicting::update_all_shards 3,787 ns 3,935 ns -3.76% ± 0.42% +0.00% ± 0.00%
simple_cold::insert_split 14,154 ns 14,694 ns -3.67% ± 0.74% +0.00% ± 0.00%
full_simple::begin 5,349 ns 5,549 ns -3.59% ± 1.85% +0.00% ± 0.00%
extended_cold::update_all_shards 3,657 ns 3,787 ns -3.43% ± 0.61% +0.00% ± 0.00%
simple_cold::update_by_key 4,314 ns 4,462 ns -3.32% ± 0.71% +0.00% ± 0.00%
extended_evicting::insert_returning 7,370 ns 7,616 ns -3.23% ± 0.39% +0.00% ± 0.00%
simple_cold::begin 1,942 ns 2,004 ns -3.08% ± 1.56% +0.00% ± 0.00%
Hot code per txn
path base head change
pooler 104.8 KB 107.4 KB +2.6 KB
sharding-w2 159.2 KB 158.1 KB -1.2 KB

pooler:

crate base head change
pgdog::frontend::client::query_engine 19.8 KB 20.2 KB +0.4 KB
tokio 17.3 KB 18.1 KB +0.8 KB
pgdog::backend::pool 16.9 KB 17.6 KB +0.7 KB
pgdog::frontend (other) 8.9 KB 9.1 KB +0.2 KB
aws-lc (TLS crypto) 7.8 KB 7.6 KB -0.2 KB
rustls (TLS) 7.4 KB 7.4 KB +0.0 KB
pgdog::backend::server 6.7 KB 6.8 KB +0.1 KB
other 5.7 KB 5.8 KB +0.1 KB
everything else 14.4 KB 14.8 KB +0.4 KB
function head change
pgdog::frontend::client::Client::run::{{closure}} 6.9 KB +0.2 KB
pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine: 5.9 KB +0.1 KB
pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}} 4.6 KB +0.1 KB
tokio::runtime::task::raw::poll 3.8 KB +0.4 KB
pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine: 3.1 KB +0.2 KB

sharding-w2:

crate base head change
pgdog::frontend::router 26.3 KB 27.0 KB +0.7 KB
pgdog::frontend::client::query_engine 22.3 KB 21.6 KB -0.8 KB
tokio 18.1 KB 18.4 KB +0.3 KB
pgdog::backend::pool 17.6 KB 17.4 KB -0.2 KB
pgdog::frontend (other) 10.2 KB 10.2 KB +0.1 KB
other 10.1 KB 10.1 KB +0.1 KB
aws-lc (TLS crypto) 10.5 KB 9.9 KB -0.6 KB
rustls (TLS) 7.4 KB 7.3 KB -0.1 KB
everything else 36.8 KB 36.1 KB -0.7 KB
function head change
pgdog::frontend::client::Client::run::{{closure}} 7.6 KB -0.1 KB
pgdog::frontend::client::query_engine::query::<impl pgdog::frontend::client::query_engine: 5.6 KB -0.2 KB
pgdog::frontend::client::query_engine::QueryEngine::handle::{{closure}} 4.8 KB -0.2 KB
pgdog::frontend::router::parser::query::select::<impl pgdog::frontend::router::parser::que 4.1 KB +0.1 KB
tokio::runtime::task::raw::poll 3.9 KB +0.1 KB
lb flamegraph vs b44e013

lb

Open interactive for hover, zoom and search.

lb removed

Open interactive.

microbench flamegraph vs b44e013

microbench

Open interactive for hover, zoom and search.

microbench removed

Open interactive.

pooler flamegraph vs b44e013

pooler

Open interactive for hover, zoom and search.

pooler removed

Open interactive.

sharding-w2 flamegraph vs b44e013

sharding-w2

Open interactive for hover, zoom and search.

sharding-w2 removed

Open interactive.

sharding-w8 flamegraph vs b44e013

sharding-w8

Open interactive for hover, zoom and search.

sharding-w8 removed

Open interactive.

Logs

lb, microbench, pooler, sharding-w2, sharding-w8, verdict.json

Compared 31e5d9d with b44e013 on c7a.metal-48xl (spot).

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.

1 participant