We are excited to announce SPQR 3.0.0! All the goals outlined in the SPQR 3.0 Roadmap have been implemented — distributed and reference tables, distributed query support, and two-phase commit for DDL/migrations across shards.
There are no breaking changes between 2.9.x and 3.0.0. We are simply opening a new chapter for SPQR and moving forward.
This release covers all changes from 2.9.9 to 3.0.0, including intermediate patch releases: 2.9.10, 2.9.11, 2.9.12
What's Changed
JOIN Routing & CTE Support
- Fix JOIN ON clause routing and add tests by @reshke #2365
- Move tuple routing logic to separate function and add test for JOIN by @reshke #2408
- Support LEFT and RIGHT join with aux-values multishard by @reshke #2409
- Fix JOIN adjust logic & add tests by @reshke #2466
- Support JOIN CTE adjust for transitive aux values routing by @reshke #2467
- Support multiple AUX CTE with one common ancestor for JOIN adjust by @reshke #2468
- Fix CTE alias referencing by @reshke #2415
- Fix relation alias resolve and add regress test by @reshke #2543
Extended Protocol & Multi-Portal
- Partially support multi-portal binding by @reshke #2519
- Stub implementation for portal suspension by @reshke #2522
- Use
ProcessOneMsgCarefullyfor Describe by @reshke #2442 - Remove custom processing in Execute by @reshke #2443
- Fix pgproto message copy for simple query & parse by @reshke #2492
- Greasify protocol negotiation in startup processing by @reshke #2608
- Respect result format code in virtual
pg_is_in_recovery()by @reshke #2517
Two-Phase Commit (2PC)
- Simple happy-path error recovery in two phase commit by @reshke #2480
- Fix transaction deploy on ROLLBACK by @reshke #2481
- Support client feedback for 2pc commit flow by @reshke #2531
- Add
__spqr__set_next_2pc_gidand use it in tests by @reshke #2536 - Fix two phase recovery utility function by @reshke #2574
- Fix 2pc tx state recovery by @reshke #2578
- Add isolation tests for 2pc failure recovery by @reshke #2482 #2485
Implicit Transactions
- Support implicit tx blocks by @reshke #2557
- Add notice message for router implicit tx feature by @reshke #2561
- Fix implicit transaction error recovery flow by @reshke #2564
Auto-Linearize for Multi-Shard DML
- Auto-linearize hazard multi-shard upserts by @reshke #2512
- Fix auto-linearize on
INSERT INTO .. RETURNINGby @reshke #2527 - Reimplement dispatch linearize as plan hinting rather than GUC injection by @reshke #2560
- Support correct command complete tag in multishard
UPDATEby @reshke #2618 #2622 - Fix multishard insert command complete tag by @reshke #2626
Data Transfer & Balancer
- Allow context cancellation for data transfer workers by @reshke #2386
- Allow to cancel data transfer task in any execution phase by @reshke #2390
- Cancel data move task only on IMMEDIATE flag by @reshke #2456
- Recheck key range status for in-flight data chunk by @reshke #2569
- GUCify in-flight data access option by @reshke #2571
- Do not perform parallel transactions on both shards in copyData by @EinKrebs #2627
- Trace all data transfer goroutines in coordinator by @reshke #2385
Metadata & Key Range Management
- Metadata version management basics by @EinKrebs #2395
- Implement router rebootstrap through SQL by @EinKrebs #2398
- Update key range metadata in spqrguard by @EinKrebs #2424
- Maintain key range meta on rename by @EinKrebs #2594
- Separate spqrguard meta update from external writes lock in config by @EinKrebs #2611
- Add a check for an exact key match in qdb/etcd by @Pavloxes #2552
Console & SQL Enhancements
HELPfor register/unregister routers, misc commands by @Denchick #2367 #2371- Enforce 80-char line limit in
HELPby @Denchick #2453 - Deprecate
ADDkeyword, useCREATEinstead by @Denchick #2038 - Implement
LOCAL&GLOBALshow kinds by @reshke #2440 - Support multistatement SQL in console by @reshke #2541
- Add
ALTER SYSTEM ROTATEfor spqr-console log rotation by @reshke #2558 - Add
SHOW SHARDS_EXTENDEDcommand by @diPhantxm #2562 - Support
ALTER SHARDin router with coordinator by @diPhantxm #2428 #2445 - Add
discard countcolumn toSHOW poolsby @reshke #2615 - Add
server_lifetimesetting to backend rules by @reshke #2616 - Improve shard-not-found errors in console by @Minetoff #2175
- SQL part of
GRANT& alter system re-bootstrap by @reshke #2381
Monitoring & Observability
- Prometheus metrics for router (MVP) by @xelavopelk #2497
- Reimplement RPS counting as part of statistics package by @reshke #2475
- Fix router tx/shard statement quantiles by @reshke #2493
- Add simple query log time on INFO level by @reshke #2532
- Add and use
TRACEseverity for some debug messages by @reshke #2533 - Write log asynchronously (router only) by @reshke #2491 #2501
- Downgrade unmatched TSA host log level from Error to Debug by @Denchick #2488
spqr-monitor
Shard Management & Networking
- Handle hosts with AZ in shard hosts validation by @diPhantxm #2486
- Pass hosts' AZ to distributed mgr by @diPhantxm #2498
- Send host list with AZ on router sync by @diPhantxm #2579
- Add gRPC validation rules by @diPhantxm #2450
- Fix memqdb rebootstrap losing shards by @diPhantxm #2441
- Make shard replicas synchronous by @EinKrebs #2515
- Change
synchronous_committoremote_applyon shards by @EinKrebs #2521 - Pin client catalog queries to dedicated shard on setup by @reshke #2609
Error Reporting
- Modernize coding around error reporting by @reshke #2372
- Switch
errComplexQueryto usespqrerrorinfrastructure by @reshke #2414 - Use SPQR-specific error format for general error report by @reshke #2433
- Report key range id as errdetail by @reshke #2423
- Set QUERY field in SPQR-specific error for simple proto by @reshke #2535
Configuration
- Support UUID HASH column type in distributions by @Denchick #2588
- Support disabling
idle_in_transaction_session_timeoutby @EinKrebs #2617 - Support no-op distribution column update by @reshke #2621
- Cache schema in relay and share between executions by @reshke #2524
Stability & Panic Fixes
- Fix panic in
SHOW relation& refactor by @EinKrebs #2407 - Fix panic in multishard conversion by @reshke #2526
- Fix router startup panic by @xelavopelk #2494
- Fix panic: unexpected proto version message size by @diPhantxm #2537
- Fix panic & release goroutines on route obsoletion by @reshke #2577
- Fix/out of range binds panic by @Ledatu #2556
- Remove panic from stat collector by @reshke #2476
- Make ICP panic action to be
os.Exit()by @reshke #2499
Code Quality & Linting
- Fix var-naming linting issues, parts 1–4 by @Denchick #2378 #2420 #2427 #2431
- Fix unchecked-type-assertion, parts 1–2 by @Denchick #2392 #2394
- Fix unexported-naming, receiver-naming, var-declaration, unnecessary-if lint issues by @Denchick #2377 #2412 #2432 #2402
- Replace
golang.org/x/exp/sliceswith stdlibslicesby @Denchick #2473 - Remove dead code by @reshke #2404 #2477 #2539
- Remove
ShardMapping, useTopologyManagerinstead by @reshke #2437
Tests
- Extended protocol tests: Copy, Close, Execute(MaxRows), simple-in-extended, BEGIN+extended and more by @rkhapov #2379 #2387 #2388 #2397 #2406 #2416 #2417 #2438 #2542 #2582 #2583
- Tests: Oid Field Description by @saneczkab #2425
- Add unit test
CmpRangesLessStringDeprecatedby @Vinter-mach #2502 - Add unit test: WHERE MatchRow by @NeSawer #2540
- Mock
ClientInfo,RuleRouterand testListClients,ListBackendConnections,ListPoolsby @AnastasiaKostareva #2451 - Fix flaky feature tests by @xelavopelk #2439 #2444 #2458 #2464
- Fix feature test flakes by isolating auth fixtures by @Denchick #2573
Documentation
- Add manual resharding guide by @singl3focus #2435
- Fix LOCK KEY RANGE behavior description by @Denchick #2448
- Fix typo in get_started guide by @kolzuk #2586
- Add isolation tests README by @Denchick #2603
DevOps & CI
- Use content hash for shard image cache by @Denchick #2452
- Fix mismatched hashFiles inputs between feature_prepare and feature runs by @Denchick #2465
- Fix CI unhealthy container log collection by @Denchick #2597
- Fix regress test teardown in
schema_qual.sqlby @Denchick #2592 - Bump PostgreSQL version by @reshke #2546
- Bumps by @dependabot #2373 #2469 #2470 #2511 #2530 #2565 #2589 #2593 #2602 #2607
New Contributors
- @saneczkab made their first contribution in #2425
- @singl3focus made their first contribution in #2435
- @Vinter-mach made their first contribution in #2502
- @NeSawer made their first contribution in #2540
- @kolzuk made their first contribution in #2586
- @Pavloxes made their first contribution in #2552
Full Changelog: 2.9.9...3.0.0