I wrote a test for  `PART MOVE TO SHARD` runs multiple times and received some unexpected behavior.

**Test description:**
1) Create a table
2) Make 2 rows insert on one shard and 1 row insert on some other
3) Stop Merges
4) Create Distributed table
5) Receive part UUID
6) Move this part multiple times
7) Make concurrent check on the number of rows

**How to reproduce**
1) CREATE TABLE IF NOT EXISTS {table_name} on CLUSTER {cluster_name}
                                                (v UInt64) "
                                                ENGINE = {table_engine}('/clickhouse/tables/replicated/{shard}/{table_name}', '{replica}') 
                                                ORDER BY tuple() 
                                                SETTINGS assign_part_uuids=1,
                                                part_moves_between_shards_enable=1,
                                                part_moves_between_shards_delay_seconds=2;

2) INSERT INTO {table_name} VALUES ({value}) - 2 rows  on one shard and 1 row on some other

3) SYSTEM STOP MERGES {table_name} - on all nodes

4) CREATE TABLE IF NOT EXISTS {table_name_d} as {table_name} 
                                                    ENGINE = Distributed({cluster_name}, currentDatabase(), {table_name})
5) SELECT uuid FROM system.parts where name = 'all_0_0_0'

6) SELECT name FROM system.parts where uuid = '{part_uuid}'
    ALTER TABLE {table_name} MOVE PART name TO SHARD '/clickhouse/tables/replicated/{shard1}/{table_name}' - multiple times

7) select count() from {table_name_d}

* ClickHouse server version to use
22.1.2
* Queries to run that lead to an unexpected result
select count() from {table_name_d}

Result: 4

**Expected behavior**
Result: 3

**Additional information**
If make retries some time result becomes correct. The test gives the correct result if put part_moves_between_shards_delay_seconds=0.

extern const int NOT_IMPLEMENTED;
    extern const int DIRECTORY_ALREADY_EXISTS;
    extern const int TOO_MANY_UNEXPECTED_DATA_PARTS;
    extern const int DUPLICATE_DATA_PART;
    extern const int NO_SUCH_COLUMN_IN_TABLE;
    extern const int LOGICAL_ERROR;
    extern const int ILLEGAL_COLUMN;
    extern const int ILLEGAL_TYPE_OF_COLUMN_FOR_FILTER;
    extern const int CORRUPTED_DATA;
    extern const int BAD_TYPE_OF_FIELD;
    extern const int BAD_ARGUMENTS;
    extern const int INVALID_PARTITION_VALUE;
    extern const int METADATA_MISMATCH;
    extern const int PART_IS_TEMPORARILY_LOCKED;
    extern const int TOO_MANY_PARTS;
    extern const int INCOMPATIBLE_COLUMNS;
    extern const int BAD_TTL_EXPRESSION;
    extern const int INCORRECT_FILE_NAME;
    extern const int BAD_DATA_PART_NAME;
    extern const int READONLY_SETTING;
    extern const int ABORTED;
    extern const int UNKNOWN_PART_TYPE;
    extern const int UNKNOWN_DISK;
    extern const int NOT_ENOUGH_SPACE;
    extern const int ALTER_OF_COLUMN_IS_FORBIDDEN;
    extern const int SUPPORT_IS_DISABLED;
    extern const int TOO_MANY_SIMULTANEOUS_QUERIES;
    extern const int INCORRECT_QUERY;
}
static void checkSampleExpression(const StorageInMemoryMetadata & metadata, bool allow_sampling_expression_not_in_primary_key, bool check_sample_column_is_correct)