No rows are written, though. Still, this may be problematic when this insert fails due to the `too many parts` error, which leads to the parent insert also failing. I haven't reproduced this failure exactly (complicated to do on localhost), but seen it happen for a ClickHouse user in Yandex.

Apparently this only happens with `insert_distributed_sync = 1`.

Cluster config:
```
        <weighted>
            <shard>
                <weight>100</weight>
                <replica>
                    <host>127.0.0.2</host>
                    <port>9000</port>
                </replica>
            </shard>
            <shard>
                <weight>0</weight>
                <replica>
                    <host>127.0.0.3</host>
                    <port>9000</port>
                </replica>
            </shard>
            <shard>
                <weight>100</weight>
                <replica>
                    <host>127.0.0.4</host>
                    <port>9000</port>
                </replica>
            </shard>
        </weighted>
```

Queries:

```
create table t_local (a int) engine MergeTree order by (a);

create table t_dist (a int) engine Distributed(weighted, 'default', 't_local', cityHash64(a));

set insert_distributed_sync = 1;

select written_rows, query_id from system.query_log where initial_query_id = '4c93852e-bdcb-436a-9ad3-4953ccedfcdc' and type != 1;
```

In the query log we see that the query is sent to all three shards, including the one with zero weight, but no rows are sent there.
```
SELECT 
    written_rows,
    query_id
FROM system.query_log
WHERE (initial_query_id = '4c93852e-bdcb-436a-9ad3-4953ccedfcdc') AND (type != 1)

┌─written_rows─┬─query_id─────────────────────────────┐
│            0 │ 177294a7-5612-45ef-bb57-2b36b73d709f │
│       499720 │ 02d724ae-5840-4805-9e5f-747a85332545 │
│       500280 │ a4692444-5409-4aec-a821-d9095e912ca1 │
│      1000000 │ 4c93852e-bdcb-436a-9ad3-4953ccedfcdc │
└──────────────┴──────────────────────────────────────┘
```

For more fun, try the `Log` engine for `t_local` -- the insert deadlocks: https://github.com/ClickHouse/ClickHouse/issues/14570
{
    auto selector = createSelector(block);
    
    const size_t num_shards = cluster->getShardsInfo().size();
    Blocks splitted_blocks(num_shards);
    for (size_t shard_idx = 0; shard_idx < num_shards; ++shard_idx)
        splitted_blocks[shard_idx] = block.cloneEmpty();
    size_t columns_in_block = block.columns();
    for (size_t col_idx_in_block = 0; col_idx_in_block < columns_in_block; ++col_idx_in_block)
    {
        MutableColumns splitted_columns = block.getByPosition(col_idx_in_block).column->scatter(num_shards, selector);
        for (size_t shard_idx = 0; shard_idx < num_shards; ++shard_idx)
            splitted_blocks[shard_idx].getByPosition(col_idx_in_block).column = std::move(splitted_columns[shard_idx]);
    }
    return splitted_blocks;
}
void DistributedBlockOutputStream::writeSplitAsync(const Block & block)
{
    Blocks splitted_blocks = splitBlock(block);
    const size_t num_shards = splitted_blocks.size();
    for (size_t shard_idx = 0; shard_idx < num_shards; ++shard_idx)
        if (splitted_blocks[shard_idx].rows())
            writeAsyncImpl(splitted_blocks[shard_idx], shard_idx);
    ++inserted_blocks;
}
void DistributedBlockOutputStream::writeAsyncImpl(const Block & block, const size_t shard_id)