Closed gmcquillan closed 9 years ago
Unfortunately, those checks are crucial to ensure that each replica has exactly the same data set. We are exploring options here (more first-class replication using something like BDR, or folding some functions on the master, like now
), but since we're doing modifications to replicas one-at-a-time, it is unsafe to evaluate anything except IMMUTABLE
functions during modifications.
Makes sense. It was mostly just curiosity that I sent this patch. I'll go ahead and close to keep the clutter out of the PR queue.
Addresses issue #108.
Mostly submitting to show that my idle curiosity is satisfied. Naturally, allowing function calls to go through to the shard workers includes a lot of unknowns, particularly around which extensions are loaded, which stored procedures have been saved, probably other things that I don't know about off the top of my head. I'm not sure what the best way to handle that would be, but maybe allowing a whitelist of function names that the maintainer of a cluster knows is on each of the postgres workers would be a good start? For now, this patch satisfies my use-case.
SUPPORT_SHARD_EXPRS
set to 'yes' will result in the preprocessor to remove the checks for expressions being passed to shard workers from the query tree.Example Table Definition:
Example before patch:
Example after patch: