mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Fixed segfault in an integration test. [#CLICKHOUSE-2]
This commit is contained in:
parent
0e7c49fe9b
commit
f89d9dbfb9
@ -641,7 +641,8 @@ int32_t ZooKeeper::tryMulti(const Ops & ops_, OpResultsPtr * out_results_)
|
||||
int32_t ZooKeeper::tryMultiUnsafe(const Ops & ops, MultiTransactionInfo & info)
|
||||
{
|
||||
info.code = multiImpl(ops, &info.op_results);
|
||||
info.ops = &ops;
|
||||
for (const OpPtr & op : ops)
|
||||
info.ops.emplace_back(op->clone());
|
||||
return info.code;
|
||||
}
|
||||
|
||||
|
@ -499,13 +499,13 @@ struct MultiTransactionInfo
|
||||
{
|
||||
MultiTransactionInfo() = default;
|
||||
|
||||
const Ops * ops = nullptr;
|
||||
Ops ops;
|
||||
int32_t code = ZOK;
|
||||
OpResultsPtr op_results;
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return ops == nullptr;
|
||||
return ops.empty();
|
||||
}
|
||||
|
||||
bool hasFailedOp() const
|
||||
@ -515,7 +515,7 @@ struct MultiTransactionInfo
|
||||
|
||||
const Op & getFailedOp() const
|
||||
{
|
||||
return *ops->at(getFailedOpIndex(op_results, code));
|
||||
return *ops.at(getFailedOpIndex(op_results, code));
|
||||
}
|
||||
|
||||
KeeperException getException() const
|
||||
@ -523,7 +523,7 @@ struct MultiTransactionInfo
|
||||
if (hasFailedOp())
|
||||
{
|
||||
size_t i = getFailedOpIndex(op_results, code);
|
||||
return KeeperException("Transaction failed at op #" + std::to_string(i) + ": " + ops->at(i)->describe(), code);
|
||||
return KeeperException("Transaction failed at op #" + std::to_string(i) + ": " + ops.at(i)->describe(), code);
|
||||
}
|
||||
else
|
||||
return KeeperException(code);
|
||||
|
@ -196,7 +196,7 @@ def test_copy_month_to_week_partition(started_cluster):
|
||||
execute_task(Task2(started_cluster), [])
|
||||
|
||||
def test_copy_month_to_week_partition_with_recovering(started_cluster):
|
||||
execute_task(Task2(started_cluster), ['--copy-fault-probability', str(0.1)])
|
||||
execute_task(Task2(started_cluster), ['--copy-fault-probability', str(0.3)])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
Reference in New Issue
Block a user