MCPcopy Create free account
hub / github.com/ByConity/ByConity / tryEnqueueReplicatedDDL

Method tryEnqueueReplicatedDDL

src/Databases/DatabaseReplicated.cpp:427–446  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427BlockIO DatabaseReplicated::tryEnqueueReplicatedDDL(const ASTPtr & query, ContextPtr query_context)
428{
429 if (is_readonly)
430 throw Exception(ErrorCodes::NO_ZOOKEEPER, "Database is in readonly mode, because it cannot connect to ZooKeeper");
431
432 if (query_context->getClientInfo().query_kind != ClientInfo::QueryKind::INITIAL_QUERY)
433 throw Exception(ErrorCodes::INCORRECT_QUERY, "It's not initial query. ON CLUSTER is not allowed for Replicated database.");
434
435 checkQueryValid(query, query_context);
436 LOG_DEBUG(log, "Proposing query: {}", queryToString(query));
437
438 DDLLogEntry entry;
439 entry.query = queryToString(query);
440 entry.initiator = ddl_worker->getCommonHostID();
441 entry.setSettingsIfRequired(query_context);
442 String node_path = ddl_worker->tryEnqueueAndExecuteEntry(entry, query_context);
443
444 Strings hosts_to_wait = getZooKeeper()->getChildren(zookeeper_path + "/replicas");
445 return getDistributedDDLStatus(node_path, entry, query_context, hosts_to_wait);
446}
447
448static UUID getTableUUIDIfReplicated(const String & metadata, ContextPtr context)
449{

Callers 4

createTableMethod · 0.80
executeToTableMethod · 0.80
executeToTablesMethod · 0.80
executeToTableImplMethod · 0.80

Calls 7

queryToStringFunction · 0.85
getDistributedDDLStatusFunction · 0.85
getCommonHostIDMethod · 0.80
setSettingsIfRequiredMethod · 0.80
getChildrenMethod · 0.80
ExceptionClass · 0.50

Tested by

no test coverage detected