You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid checking permission of Babelfish temp tables on parallel worker (#568)
Consider following facts,
1. Babelfish temp tables are implemented using ENR which is not shared between different backends. So if Parallel
worker tries to check permissions on Babelfish then it will fail.
2. Any user should be able to access Babelfish temp tables under given session.
3. Postgres by default does not allow parallel operations on temp tables. Attempt to do so will result in run time error.
Due to above facts, we should avoid permission check on temp tables within parallel workers while ensuring that
leader does required permission check on other tables. This commits achieves this behaviour by introducing following
three hooks,
ParallelQueryMain_hook -- Hook that allows other extensions to pass on additional details from Leader node to
parallel worker. For example, Babelfish extension can pass details of Babelfish temp table defined under current
session with Parallel workers.
ExecInitParallelPlan_hook -- Hook that allows Parallel worker to gather additional details passed by Leader node.
For example, Babelfish extension can collect the details of Babelfish temp table shared by Leader node so that it
can avoid permission checks.
ExecCheckOneRelPerms_hook -- Hook that allows extension control permission checking on given relation/table.
For example, Babelfish can use it to avoid permission check on temp tables under parallel worker.
Task: BABEL-5703
Signed-off-by: Dipesh Dhameliya <[email protected]>
(cherry picked from commit 5e62ffa)
0 commit comments