mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
do not update digest during recovery
This commit is contained in:
parent
9240a82c64
commit
50ee424148
@ -1181,7 +1181,7 @@ void DatabaseReplicated::dropTable(ContextPtr local_context, const String & tabl
|
|||||||
std::lock_guard lock{metadata_mutex};
|
std::lock_guard lock{metadata_mutex};
|
||||||
UInt64 new_digest = tables_metadata_digest;
|
UInt64 new_digest = tables_metadata_digest;
|
||||||
new_digest -= getMetadataHash(table_name);
|
new_digest -= getMetadataHash(table_name);
|
||||||
if (txn && !txn->isCreateOrReplaceQuery())
|
if (txn && !txn->isCreateOrReplaceQuery() && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
|
|
||||||
DatabaseAtomic::dropTableImpl(local_context, table_name, sync);
|
DatabaseAtomic::dropTableImpl(local_context, table_name, sync);
|
||||||
@ -1235,7 +1235,7 @@ void DatabaseReplicated::renameTable(ContextPtr local_context, const String & ta
|
|||||||
new_digest -= DB::getMetadataHash(to_table_name, statement_to);
|
new_digest -= DB::getMetadataHash(to_table_name, statement_to);
|
||||||
new_digest += DB::getMetadataHash(table_name, statement_to);
|
new_digest += DB::getMetadataHash(table_name, statement_to);
|
||||||
}
|
}
|
||||||
if (txn)
|
if (txn && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
|
|
||||||
DatabaseAtomic::renameTable(local_context, table_name, to_database, to_table_name, exchange, dictionary);
|
DatabaseAtomic::renameTable(local_context, table_name, to_database, to_table_name, exchange, dictionary);
|
||||||
@ -1261,7 +1261,7 @@ void DatabaseReplicated::commitCreateTable(const ASTCreateQuery & query, const S
|
|||||||
std::lock_guard lock{metadata_mutex};
|
std::lock_guard lock{metadata_mutex};
|
||||||
UInt64 new_digest = tables_metadata_digest;
|
UInt64 new_digest = tables_metadata_digest;
|
||||||
new_digest += DB::getMetadataHash(query.getTable(), statement);
|
new_digest += DB::getMetadataHash(query.getTable(), statement);
|
||||||
if (txn && !txn->isCreateOrReplaceQuery())
|
if (txn && !txn->isCreateOrReplaceQuery() && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
|
|
||||||
DatabaseAtomic::commitCreateTable(query, table, table_metadata_tmp_path, table_metadata_path, query_context);
|
DatabaseAtomic::commitCreateTable(query, table, table_metadata_tmp_path, table_metadata_path, query_context);
|
||||||
@ -1285,7 +1285,7 @@ void DatabaseReplicated::commitAlterTable(const StorageID & table_id,
|
|||||||
UInt64 new_digest = tables_metadata_digest;
|
UInt64 new_digest = tables_metadata_digest;
|
||||||
new_digest -= getMetadataHash(table_id.table_name);
|
new_digest -= getMetadataHash(table_id.table_name);
|
||||||
new_digest += DB::getMetadataHash(table_id.table_name, statement);
|
new_digest += DB::getMetadataHash(table_id.table_name, statement);
|
||||||
if (txn)
|
if (txn && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
|
|
||||||
DatabaseAtomic::commitAlterTable(table_id, table_metadata_tmp_path, table_metadata_path, statement, query_context);
|
DatabaseAtomic::commitAlterTable(table_id, table_metadata_tmp_path, table_metadata_path, statement, query_context);
|
||||||
@ -1308,7 +1308,7 @@ void DatabaseReplicated::detachTablePermanently(ContextPtr local_context, const
|
|||||||
std::lock_guard lock{metadata_mutex};
|
std::lock_guard lock{metadata_mutex};
|
||||||
UInt64 new_digest = tables_metadata_digest;
|
UInt64 new_digest = tables_metadata_digest;
|
||||||
new_digest -= getMetadataHash(table_name);
|
new_digest -= getMetadataHash(table_name);
|
||||||
if (txn)
|
if (txn && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
|
|
||||||
DatabaseAtomic::detachTablePermanently(local_context, table_name);
|
DatabaseAtomic::detachTablePermanently(local_context, table_name);
|
||||||
@ -1332,7 +1332,7 @@ void DatabaseReplicated::removeDetachedPermanentlyFlag(ContextPtr local_context,
|
|||||||
if (attach)
|
if (attach)
|
||||||
{
|
{
|
||||||
new_digest += getMetadataHash(table_name);
|
new_digest += getMetadataHash(table_name);
|
||||||
if (txn)
|
if (txn && !is_recovering)
|
||||||
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
txn->addOp(zkutil::makeSetRequest(replica_path + "/digest", toString(new_digest), -1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user