jrgemignani opened a new pull request, #2592:
URL: https://github.com/apache/age/pull/2592
## Summary
This five-commit follow-up to #2561 improves VLE graph lifetime, scan
semantics, and RLS handling. It has no SQL, catalog, extension-version, or
function-declaration changes.
## Changes
### Lifecycle and correctness
- Pin each traversal's graph context to the query memory context. Invalidated
contexts are retired and reclaimed after the last query pin is released,
including error cleanup.
- Materialize a VLE path only from a context that still contains every
referenced vertex and edge. If none is available, raise a runtime error
rather than dereferencing missing graph state.
- Reuse RLS-filtered graphs within a statement according to PostgreSQL scan
semantics. The loading traversal retains its scan across the statement's
own writes. Separate traversals share a graph only when the applied RLS
quals are fixed for the statement.
- Return null from vertex_stats() when a vertex is absent from the caller's
traversal graph.
- Return no paths when RLS leaves a graph with no visible vertices.
### RLS hardening
- Support roles holding the required column privileges without requiring
access to ctid. These loads retain owned property values.
- Refuse RLS graph loading in a parallel operation because a worker cannot
reproduce all session-dependent policy state. Serial execution and labels
without RLS are unchanged.
## Performance
The 400-edge review workload previously evaluated its policy 160,000 times.
It now evaluates it 400 times. A 200-row RLS DETACH DELETE workload retains
one graph copy instead of one per row and completed in approximately half the
time in local measurements. Non-RLS VLE medians remained within 1.3% of the
comparison revision.
## Tests and validation
rls_vle Parts 8-12 cover:
- interleaved traversals and delayed path materialization;
- query errors, cache deletion, and stored-path behavior;
- immutable, stable, volatile, and setting-dependent policies;
- writes and policy or role changes during a statement;
- RLS and non-RLS DETACH DELETE;
- vertex_stats(), column grants, fully hidden graphs, and parallel
operations.
PostgreSQL 18.3:
- debug (`--enable-cassert`, `-O0`) and release (`-O2`);
- clean `-Werror` builds;
- 47/47 tests passed in each mode, including pgvector, fuzzystrmatch, and
pg_trgm;
- no compiler warnings.
New regression sections were also checked red/green against their preceding
commits.
## Scope
- No SQL, catalog, extension-version, or function-declaration changes.
- PostgreSQL inheritance-parent RLS behavior is unchanged.
- Persisted VLE paths are not made portable across backend sessions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]