Upgrade story for extensions that use Citus tables
- Dominant language
- C
- Stars
- 12.8k
- Forks
- 794
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 31
Description
It can be useful to call create_reference_table or create_distributed_table on tables owned by an extension, for instance to share metadata of the extension across all the nodes. This needs to be done outside of the CREATE EXTENSION script, since all Citus hooks are disabled within the script. As long as the extension only accesses its tables via SQL, this can work well.
However, when it is time to upgrade the extension via ALTER EXTENSION, this model becomes quite cumbersome. Any changes to Citus tables (including DDL, DML, new tables, drop table) need to be done separately from the extension upgrade script, in a post-upgrade function that gets called only on the coordinator. Every extension is currently on the hook for writing the post-upgrade infrastructure. It would be useful if Citus provided this.
I suspect the cleanest solution might be to not actually run the CREATE/ALTER extension scripts on worker nodes, but rather propagate all objects from the CREATE/ALTER extension scripts on the coordinator. That way, the coordinator can easily orchestrate operations on Citus tables along with operations on objects. It may also enable the use of Citus tables for extensions that did not explicitly add support for it. However, this is also the hardest to implement.
Contributor guide
Assessment
This issue has not been assessed yet.