Skip to content

copy_to_distributed_table in contrib package fails to mark inactive shards #95

@metdos

Description

@metdos

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;

  1. Start a 2+1 pg_shard cluster.
  2. Create customer_reviews table as in pg_shard documentation and create shard placements.
  3. Shutdown one of the worker nodes.
  4. Start copy_to_distributed_table
    /usr/local/pgsql/bin/copy_to_distributed_table -CH -n NULL customer_reviews_1998.csv customer_reviews
  5. And shutdown (ctrl + c) it, before it completes.
  6. Check pgs_distribution_metadata.shard_placement and see none of shard placements are marked as inactive.
  7. Run queries…
    1. Run select count(*) from customer_reviews;
    2. Start closed worker node.
    3. Again run select count(*) from customer_reviews; and see results are different.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions