-
Notifications
You must be signed in to change notification settings - Fork 695
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
Cannot distribute a Citus local table with an identity column #7888
Comments
Hey Nick, This operation Currently, you cannot convert a Citus local table to a Citus distributed table if they have an identity column. To overcome this issue, you can distribute the table before Given your foreign keys, it will ask you to create the reference table first. So, my advice would be to remove the foreign keys from the table definition, and add them later, after you have distributed the tables. Also, note that table distribution will still fail, because you have a primary key on
|
Thank you @naisila! The example I provided is a pretty simple one just to demonstrate the issue, the actual issue is occurring in a much larger DB as we're testing implementing distribution prior to pushing to the live production DB. In our actual database, all of the foreign key relationships already exist, there is data in the tables, and identities are already present as we're trying to implement distribution to several dozen tables. We'll explore the possibility of disabling all of our foreign keys during deployment and then re-enabling, but I still would consider this somewhat of a workaround. Do you know if this is considered a bug or feature, and is there a timeline to when local tables could be distributed if they have an identity? We could potentially delay our multi-tenancy initiative depending on the timeline. Re: distributed table not having the distribution key in the primary key of the table, this was just an oversight while I was putting together the example script :) |
Yes, that would be a workaround. I also suggest that you try the workaround first with the simple example that you used to demonstrate the issue, before trying on the larger DB.
Well, rather than distributing a Citus local table, we look at this as "converting a Citus local table to a Citus distributed table". Like, moving from one Citus table type to another. The limitation arises from maintenance of metadata consistency. As you may know, Citus local tables are "managed" by Citus and are actually visible from all nodes. Therefore, they have Citus metadata to be taken care of. Implementation-wise, this is not trivial, and we haven't prioritized this case yet. Given your experience with conversion of citus local tables to distributed ones, we will bump this up in the priority list. I will let you know if/when we have a precise timeline on this. Thanks a lot for sharing your use-case.
Good to know. |
Hello! While implementing Citus distributed and reference tables, we encountered an issue attempting to distribute a table that had an identity column. Repro steps below:
Citus version: Citus 12.1.6 on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
The text was updated successfully, but these errors were encountered: