Skip to content
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

Add function to sync metadata to CitusDB #56

Merged
merged 9 commits into from Jan 20, 2015

Conversation

jasonmp85
Copy link
Collaborator

I went back and forth as to whether this should be included with pg_shard proper or implemented in a separate extension but ultimately decided the former would be too complicated. Besides, we already have a GUC for CitusDB-related behavior so this isn't setting a new precedent re: encapsulation or anything.

I investigated whether making the C function entirely independently of the rest of the code was worthwhile, but as this is all in one extension that seemed a bit extreme. Another avenue I pursued was moving the longer PL/pgSQL function out to its own file. This blog post gave me some ideas, but I think they're not worth implementing at the moment.

So I cleaned up whitespace, added function comments, added UPSERT-like logic, and ensured we handled NULL inputs at all points in the call chain. I'm writing the rest of my unit tests now and will push them up shortly.

fixes #26.

sumedhpathak and others added 5 commits January 19, 2015 15:12
Performs an on-demand sync from pg_shard's metadata to that of Citus.
Now the only C function remaining returns the Var representation of the
partition column.
Also converted the C function to use an Oid, thus allowing us to keep ResolveRelationId unchanged.
We won't call it this way, but just in case.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.54%) when pulling 59b6d9b on feature-citus_integration-#26 into 304cd8f on develop.


/* declarations for dynamic loading */
PG_FUNCTION_INFO_V1(partition_column_to_node_string);
Datum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add spacing between the declaration, and also more importantly add a function comment?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

We use tabs, so switched to those. Also added NOT NULL and CONSTANT
modifiers to make variable declaration more explicit. Finally, added
function comments, which will display when users ask for descriptions
of functions.
Tests nodeToString internal UDF as well as the user-facing sync UDF.
@jasonmp85 jasonmp85 force-pushed the feature-citus_integration-#26 branch from 59b6d9b to f013b29 Compare January 20, 2015 02:01
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling f013b29 on feature-citus_integration-#26 into 304cd8f on develop.

Feedback from IWYU.
@sumedhpathak
Copy link
Contributor

:shipit:

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling 0c0c3d3 on feature-citus_integration-#26 into 304cd8f on develop.

jasonmp85 added a commit that referenced this pull request Jan 20, 2015
@jasonmp85 jasonmp85 merged commit c56862e into develop Jan 20, 2015
@jasonmp85 jasonmp85 deleted the feature-citus_integration-#26 branch January 20, 2015 02:37
@jasonmp85 jasonmp85 mentioned this pull request Feb 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve metadata synchronization
3 participants