Skip to content

Commit

Permalink
cassandra: adds log statement to help debug schema install failure (#…
Browse files Browse the repository at this point in the history
…3740)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt committed Feb 29, 2024
1 parent 9acae64 commit e9b55ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static Version ensureVersion(com.datastax.oss.driver.api.core.metadata.Metadata
}
}
if (version == null) throw new RuntimeException("No nodes in the cluster");
LOG.info("Detected Cassandra version {}", version);
return version;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ abstract class ITEnsureSchema extends ITStorage<CassandraStorage> {
abstract CqlSession session();

@Test void installsKeyspaceWhenMissing() {
Schema.ensureExists(storage.keyspace, true, session());

KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
assertThat(metadata).isNotNull();
}

@Test void installsKeyspaceWhenMissing_searchDisabled() {
Schema.ensureExists(storage.keyspace, false, session());

KeyspaceMetadata metadata = session().getMetadata().getKeyspace(storage.keyspace).get();
Expand Down

0 comments on commit e9b55ef

Please sign in to comment.