cannot take a number of unlocked abandonable lock

This commit is contained in:
Alexey Zatelepin 2018-05-31 20:28:17 +03:00
parent c9bb986330
commit f63d2dc3c8
2 changed files with 2 additions and 1 deletions

View File

@ -3126,8 +3126,8 @@ bool StorageReplicatedMergeTree::getFakePartCoveringAllPartsInPartition(const St
{
auto zookeeper = getZooKeeper();
auto block_number_lock = allocateBlockNumber(partition_id, zookeeper);
block_number_lock->unlock();
right = block_number_lock->getNumber();
block_number_lock->unlock();
mutation_version = queue.getCurrentMutationVersion(partition_id, right);
}

View File

@ -109,6 +109,7 @@ DROP TABLE test.src;
-- do not wait other replicas to execute OPTIMIZE
SET replication_alter_partitions_sync=0, optimize_throw_if_noop=1;
SELECT count(), sum(d), uniqExact(_part) FROM test.dst_r1;
SYSTEM SYNC REPLICA test.dst_r1;
OPTIMIZE TABLE test.dst_r1 PARTITION 1;
SET replication_alter_partitions_sync=1;
SYSTEM SYNC REPLICA test.dst_r1;