Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA STATUS improvements #9863

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public OHaStatusStatement(OrientSql p, int id) {
super(p, id);
}

@Override
public boolean isIdempotent() {
return true;
}

@Override
public void toString(Map<Object, Object> params, StringBuilder builder) {
builder.append("HA STATUS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,20 @@ public ODocument getClusterConfiguration() {
final List<ODocument> members = new ArrayList<ODocument>();
cluster.field("members", members, OType.EMBEDDEDLIST);
for (Member member : activeNodes.values()) {
members.add(getNodeConfigurationByUuid(member.getUuid(), true));
final ODocument memberConfig = getNodeConfigurationByUuid(member.getUuid(), true).copy();
if (memberConfig == null) {
continue;
}
members.add(memberConfig);

final String nodeName = getNodeName(member);
final Map<String, String> dbStatus = new HashMap<>();
memberConfig.field("databasesStatus", dbStatus, OType.EMBEDDEDMAP);
// Member DB status
for (String db : getManagedDatabases()) {
final DB_STATUS nodeDbState = getDatabaseStatus(nodeName, db);
dbStatus.put(db, nodeDbState.toString());
}
}

return cluster;
Expand Down