debug stress address

This commit is contained in:
ivan-kush 2019-05-02 16:42:09 +03:00
parent 591325468b
commit 3ecb66d965
2 changed files with 12 additions and 6 deletions

View File

@ -1612,16 +1612,18 @@ void MergeTreeData::freezeAll(const String & with_name, const Context & context)
bool MergeTreeData::AlterDataPartTransaction::isValid() const
{
return data_part != nullptr;
return valid && data_part;
}
void MergeTreeData::AlterDataPartTransaction::clear()
{
data_part = nullptr;
valid = false;
}
void MergeTreeData::AlterDataPartTransaction::commit()
{
if (!isValid())
return;
if (!data_part)
return;
@ -1682,13 +1684,14 @@ void MergeTreeData::AlterDataPartTransaction::commit()
MergeTreeData::AlterDataPartTransaction::~AlterDataPartTransaction()
{
alter_lock.unlock();
if (!isValid())
return;
if (!data_part)
return;
try
{
if (!data_part)
return;
LOG_WARNING(data_part->storage.log, "Aborting ALTER of part " << data_part->relative_path);
String path = data_part->getFullPath();

View File

@ -235,6 +235,9 @@ public:
friend class MergeTreeData;
void clear();
bool valid = true;
//don't interchange order of data_part & alter_lock
DataPartPtr data_part;
DataPartsLock alter_lock;