-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider issuing DDL commands on the master before the worker nodes #357
Comments
I think this is the real way to fix #350. It's PR is just a quick fix for this underlying problem. |
Finally getting around to doing a brain dump here. Basically, as @anarazel has pointed out, it would be nicer to execute the master's DDL command first as this allows some piggybacking on the locking semantics already provided by PostgreSQL. The existing ways we handle DDL commands in the utility hook are:
Each of these returns a possibly-modified parse tree which is subsequently executed by a call to
After poking around the various
I'm putting a checklist up top with what I've done and am doing. Estimated time: PR out today. |
@jasonmp85 I think execute (remote) part can be separated to execute (worker distributed table) and execute (shards). |
@anarazel mentioned
"Executing the DDL on the workers before doing so on the master strikes me as rather fragile. There's always going to be problems without using 2PC, but if we were to do this on the master first, we'd at least have a chance to mark the shards where the statement failed as broken. This way round there's no way of doing that."
The rationale for doing this on the worker nodes first was to verify that the command can go through on atleast one shard before we commit to doing it on the master.
However, since we can rollback on the master node in case a query fails on the first worker node, we could run it on the master first. So, there don't seem to be advantages of doing it on the workers before doing it on the master.
However, if we do execute it on the master first, we have the ability to rollback and that makes it better for certain cases.
Plan
multi_ProcessUtility
to better separate DDL mode from other modesstandard_ProcessUtility
to happen firstThe text was updated successfully, but these errors were encountered: