citusdata / citus

Distributed PostgreSQL as an extension
https://www.citusdata.com
GNU Affero General Public License v3.0
10.49k stars 666 forks source link

shard not found for non-fastpath queries during concurrent create_distributed_table_concurrently execution #6360

Open aykut-bozkurt opened 2 years ago

aykut-bozkurt commented 2 years ago

Problem: Shards in non-fast-path insert queries may be invalid because they are deleted by a concurrent create_distributed_table_concurrently. Example case:

session1:
select create_distributed_table_concurrently('xx','id');
session2:
insert into xx select random();
ERROR: could not find valid entry for shard xxx

Expected Solution: We should reroute invalid shards for those queries to prevent unpleasant error logs and execute the query if possible.

onderkalaci commented 2 years ago

Related to #6280