If I shutdown(ctrl + c) copy_to_distributed_table while it is working, it fails to mark shards on closed node as inactive. If I wait copy_to_distributed_table to complete, then it marks shards inactive on closed node as properly.
Here are steps to replicate problem;
- Start a 2+1 pg_shard cluster.
- Create customer_reviews table as in pg_shard documentation and create shard placements.
- Shutdown one of the worker nodes.
- Start copy_to_distributed_table
/usr/local/pgsql/bin/copy_to_distributed_table -CH -n NULL customer_reviews_1998.csv customer_reviews
- And shutdown (ctrl + c) it, before it completes.
- Check pgs_distribution_metadata.shard_placement and see none of shard placements are marked as inactive.
- Run queries…
- Run
select count(*) from customer_reviews;
- Start closed worker node.
- Again run
select count(*) from customer_reviews; and see results are different.
If I shutdown(ctrl + c) copy_to_distributed_table while it is working, it fails to mark shards on closed node as inactive. If I wait copy_to_distributed_table to complete, then it marks shards inactive on closed node as properly.
Here are steps to replicate problem;
/usr/local/pgsql/bin/copy_to_distributed_table -CH -n NULL customer_reviews_1998.csv customer_reviewsselect count(*) from customer_reviews;select count(*) from customer_reviews;and see results are different.