feat: cache programmatic translations with rollback control - BED-9469 - #131
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
Included review availability: 1 review is currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. WalkthroughThe PostgreSQL driver now prepares regular Cypher queries, caches optimized translation shapes, supports atomic optimization control, and rebinds request values on cache hits. Query wiring, relationship updates, documentation, unit tests, and PostgreSQL integration tests were updated. ChangesPostgreSQL translation cache
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The PR is merge-ready after normal checks and review; no actionable merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant Application
participant liveQuery
participant schemaManager
participant translationCache
participant PostgreSQL
Application->>liveQuery: execute regular Cypher query
liveQuery->>schemaManager: prepare and compile query
schemaManager->>translationCache: lookup translation shape
translationCache-->>schemaManager: return cached or newly built shape
schemaManager->>PostgreSQL: execute SQL with rebound values
PostgreSQL-->>Application: return query result
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description follows the required template, explains the change and motivation, identifies BED-9469, documents the affected PostgreSQL driver, and lists testing and checklist items. The integration-test checkbox is not selected even though integration tests were added, but the description is otherwise complete. Full details: Docstring CoverageExplanation Docstring coverage is 10.34% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 29 functions across 8 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
0e49d6d to
4a2ebe1
Compare
|
|
||
| import "sync/atomic" | ||
|
|
||
| var optimizedTranslationEnabled atomic.Bool |
There was a problem hiding this comment.
I know but at least I didn't bleed the atomic as a global exported variable :)
4a2ebe1 to
cf95509
Compare
cf95509 to
6dba32a
Compare
6dba32a to
ef4c854
Compare
ef4c854 to
221a3e0
Compare
221a3e0 to
2a80796
Compare
Description
Extends translation reuse to PostgreSQL programmatic queries and adds an immediate process-wide rollback control.
The profiled regression is dominated by
FetchStartNodesand related programmatic queries, which bypassed theraw-Cypher cache path. This layer reaches that hot path while preserving a fleet-wide, zero-critical-section rollback
switch if the optimized path needs to be disabled.
pg.SetOptimizedTranslationfor atomically enabling or disabling both optimization and caching.Resolves: BED-9469
Type of Change
Testing
make test_allwithCONNECTION_STRINGset)Screenshots (if appropriate):
Driver Impact
drivers/pg)drivers/neo4j)Checklist
go.mod/go.sumare up to date if dependencies changedStack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit
New Features
Bug Fixes
Documentation