When using schema-based sharding, standalone sequences not propagated to workers after created on the coordinator #8463
Replies: 2 comments 1 reply
-
|
Yes, this is expected. We don't propagate sequences to other nodes unless a distributed object depends on them, like a distributed table or a schema-distributed table. And the reason why we don't disallow this on workers is the assumption that, e.g., it may be later used by a local table on that node. And this also applies to the sequences created at schemas used for schema-based-sharding. This is because, except that we treat the tables created at those schemas as schema-distributed tables, we treat the objects created at those schemas just as node-local objects unless a distributed object depends on them, as it's the case for other schemas. From users' perspective, would you prefer sequences created at those schemas to be automatically distributed as well, or do you think not allowing this (at schemas used for schema-based sharding) would make more sense? Side-node: If we automatically distributed such sequences, we would probably assign different sequence min / max ranges for them on workers as we do for the sequences that we automatically propagate to all nodes. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your response! I can only speak about schema-based sharding. In a multi-tenant SaaS app, all queries are scoped to a single tenant. Regarding your question, I would prefer sequences to not be allowed by default, but rather distributed with an explicit option if they come with some limitations.I think this is the case for triggers. I would also expect all DDL commands to fail on worker nodes, regardless of the object type being created in a distributed schema. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I am using schema-based sharding in Citus version 13.2.0.
I noticed that sequences owned by columns (e.g., from BIGSERIAL) are propagated to workers, but standalone sequences created with CREATE SEQUENCE are not.
You can easily reproduce this behavior with the following steps:
After connecting to the worker, we can verify that orders_id_seq exists there but the standalone sequence does not.
I've also noticed some inconsistent behavior:
Is this expected behavior or a bug?
If standalone sequences are not supported in distributed schemas, I would expect an error to be thrown when creating a standalone sequence on the coordinator within a distributed schema or when creating a sequence directly on a worker node
Beta Was this translation helpful? Give feedback.
All reactions