hqbhoho commented on code in PR #8419:
URL: https://github.com/apache/gravitino/pull/8419#discussion_r2329481274
##########
trino-connector/integration-test/src/test/java/org/apache/gravitino/trino/connector/integration/test/TrinoQueryITBase.java:
##########
@@ -103,7 +113,10 @@ public void setup() throws Exception {
setEnv();
trinoQueryRunner = new TrinoQueryRunner(trinoUri);
- createMetalake();
+
+ if (!autoStart) {
+ createMetalake();
+ }
Review Comment:
> Why does it exit? Do you have any error messages? I think they have no
dependency relationship.
`CatalogConnectorManager` will `loadMetalake` in a schedule thread. If
metalake is not exists, it will exit.
```
private void loadMetalake() {
try {
if (!catalogRegister.isTrinoStarted()) {
LOG.info("Waiting for the Trino started.");
return;
}
Set<String> usedMetalakes = new HashSet<>();
if (config.singleMetalakeMode()) {
usedMetalakes.add(targetMetalake);
metalakes.computeIfAbsent(targetMetalake, this::retrieveMetalake);
} else {
GravitinoMetalake[] allMetalakes = gravitinoClient.listMetalakes();
for (GravitinoMetalake metalake : allMetalakes) {
usedMetalakes.add(metalake.name());
metalakes.put(metalake.name(), metalake);
}
}
for (String usedMetalake : usedMetalakes) {
try {
GravitinoMetalake metalake = metalakes.get(usedMetalake);
LOG.debug("Load metalake: {}", usedMetalake);
loadCatalogs(metalake);
} catch (Exception e) {
LOG.error("Load Metalake {} failed.", usedMetalake, e);
}
}
} catch (Exception e) {
LOG.error("Error when loading metalake", e);
System.exit(-1);
}
}
```
Currently, `createMetalake` is called after the container starts. So Trino
master will exit if `loadMetalake` is called when `createMetalake` is not
called, but the failures are very sporadic.
The creation of a metalake before the Trino cluster is deployed is better.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]