Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
#255 Fixed ordering of deploying groups
Browse files Browse the repository at this point in the history
And only updating group servers if the group was just created
  • Loading branch information
rjrudin committed Mar 14, 2018
1 parent 3bfc041 commit eb4949b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@

public abstract class SortOrderConstants {

public static Integer DEPLOY_GROUPS = 5;

public static Integer DEPLOY_PRIVILEGES = 10;
public static Integer DEPLOY_ROLES = 20;
public static Integer DEPLOY_USERS = 30;
public static Integer DEPLOY_CERTIFICATE_TEMPLATES = 50;
public static Integer GENERATE_TEMPORARY_CERTIFICATE = 55;
public static Integer DEPLOY_CERTIFICATE_AUTHORITIES = 60;
public static Integer DEPLOY_EXTERNAL_SECURITY = 70;
public static Integer DEPLOY_PROTECTED_COLLECTIONS = 80;
public static Integer DEPLOY_MIMETYPES = 90;
public static Integer DEPLOY_PROTECTED_PATHS = 95;
public static Integer DEPLOY_QUERY_ROLESETS = 97;
public static Integer DEPLOY_PRIVILEGES = 5;
public static Integer DEPLOY_ROLES = 10;
public static Integer DEPLOY_USERS = 15;
public static Integer DEPLOY_CERTIFICATE_TEMPLATES = 20;
public static Integer GENERATE_TEMPORARY_CERTIFICATE = 25;
public static Integer DEPLOY_CERTIFICATE_AUTHORITIES = 30;
public static Integer DEPLOY_EXTERNAL_SECURITY = 35;
public static Integer DEPLOY_PROTECTED_COLLECTIONS = 40;
public static Integer DEPLOY_MIMETYPES = 45;
public static Integer DEPLOY_PROTECTED_PATHS = 50;
public static Integer DEPLOY_QUERY_ROLESETS = 55;

public static Integer DEPLOY_GROUPS = 90;

// Hosts need to be assigned to their group before databases are created.
// This is so that when forests are created based on the mlDatabaseGroups
// then the forests will be created on the correct hosts.
public static Integer ASSIGN_HOSTS_TO_GROUPS = 98;
public static Integer ASSIGN_HOSTS_TO_GROUPS = 95;

public static Integer DEPLOY_TRIGGERS_DATABASE = 100;
public static Integer DEPLOY_SCHEMAS_DATABASE = 100;
Expand Down Expand Up @@ -69,7 +69,10 @@ public abstract class SortOrderConstants {

public static Integer DEPLOY_FOREST_REPLICAS = 1200;

// Undo constants
public static Integer DELETE_MIMETYPES = 8500;

public static Integer UNASSIGN_HOSTS_FROM_GROUPS = 8590;
public static Integer DELETE_GROUPS = 8600;

public static Integer DELETE_USERS = 9000;
public static Integer DELETE_CERTIFICATE_TEMPLATES = 9010;
Expand All @@ -83,10 +86,6 @@ public abstract class SortOrderConstants {
// Protected paths reference roles
public static Integer DELETE_PROTECTED_PATHS = 9080;

public static Integer DELETE_GROUPS = 8600;
public static Integer UNASSIGN_HOSTS_FROM_GROUPS = 8590;

public static Integer DELETE_MIMETYPES = 8500;

/*
* This executes before databases are deleted, as deleting databases normally deletes the primary forests, so we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,21 @@ protected void afterResourceSaved(ResourceManager mgr, CommandContext context, F
}
context.getAdminManager().waitForRestart();
}
}

// When new groups are created, an Admin server is automatically created in that group.
// However, the Admin server's rewrite property is empty - causing problems with reading the timestamp
if (receipt.hasLocationHeader()) {
// When new groups are created, an Admin server is automatically created in that group.
// However, the Admin server's rewrite property is empty - causing problems with reading the timestamp
String groupName = new PayloadParser().getPayloadFieldValue(payload, "group-name", true);
ServerManager serverMgr = new ServerManager(context.getManageClient(), groupName);
if (fixAdminServerRewriter) {
if (logger.isInfoEnabled()) {
logger.info(format("Updating admin server in group %s to ensure that its url-rewriter is correct", groupName));
if (logger.isInfoEnabled()) {
logger.info(format("Updating admin server in group %s to ensure that its url-rewriter is correct", groupName));
}
serverMgr.save(adminServerTemplate.getJson());
}

ensureGroupServersExist(serverMgr, groupName);
ensureGroupServersExist(serverMgr, groupName);
}
}

Expand Down

0 comments on commit eb4949b

Please sign in to comment.