Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

initial broker pairing algo

  • Loading branch information...
commit 660891df7a68159fb54ff951cd194c4ef2215458 1 parent 070d38b
root authored
Showing with 28 additions and 2 deletions.
  1. +0 −1  cluster/handlers-state.c
  2. +28 −1 cluster/handlers.c
View
1  cluster/handlers-state.c
@@ -116,7 +116,6 @@ int doDescribeServices(ncMetadata *ccMeta, serviceInfoType *serviceIds, int serv
}
*/
sem_mywait(CONFIG);
- logprintfl(EUCADEBUG, "MEH: %s\n", config->ccStatus.serviceId.name);
if (!strcmp(config->ccStatus.serviceId.name, "self")) {
for (i=0; i<serviceIdsLen; i++) {
logprintfl(EUCADEBUG, "DescribeServices(): received input serviceId[%d]\n", i);
View
29 cluster/handlers.c
@@ -2813,6 +2813,8 @@ int ccCheckState() {
char localDetails[1024];
int ret=0;
char cmd[MAX_PATH];
+ char buri[MAX_PATH], uriType[32], bhost[MAX_PATH], path[MAX_PATH], curi[MAX_PATH], chost[MAX_PATH];
+ int port, done=0, i, j, rc;
if (!config) {
return(1);
@@ -2857,6 +2859,31 @@ int ccCheckState() {
// network
+ // broker pairing algo
+ for (i=0; i<16; i++) {
+ int j;
+ if (strlen(config->notreadyServices[i].type)) {
+ if (!strcmp(config->notreadyServices[i].type, "vmwarebroker")) {
+ for (j=0; j<8; j++) {
+ if (strlen(config->notreadyServices[i].uris[j])) {
+ logprintfl(EUCADEBUG, "ccCheckState(): found broker - %s\n", config->notreadyServices[i].uris[j]);
+
+ snprintf(buri, MAX_PATH, "%s", config->notreadyServices[i].uris[j]);
+ bzero(bhost, sizeof(char) * MAX_PATH);
+ rc = tokenize_uri(buri, uriType, bhost, &port, path);
+
+ snprintf(curi, MAX_PATH, "%s", config->ccStatus.serviceId.uris[0]);
+ bzero(chost, sizeof(char) * MAX_PATH);
+ rc = tokenize_uri(curi, uriType, chost, &port, path);
+ if (!strcmp(curi, buri)) {
+ logprintfl(EUCAWARN, "ccCheckState(): detected local broker in not ready state\n");
+ }
+ }
+ }
+ }
+ }
+ }
+
snprintf(localDetails, 1023, "ERRORS=%d", ret);
sem_mywait(CONFIG);
snprintf(config->ccStatus.details, 1023, "%s", localDetails);
@@ -3760,7 +3787,7 @@ int init_config(void) {
config->ncFanout = ncFanout;
locks[REFRESHLOCK] = sem_open("/eucalyptusCCrefreshLock", O_CREAT, 0644, config->ncFanout);
config->initialized = 1;
- ccChangeState(LOADED);
+ ccChangeState(NOTREADY);
config->ccStatus.localEpoch = 0;
snprintf(config->ccStatus.details, 1024, "ERRORS=0");
snprintf(config->ccStatus.serviceId.type, 32, "cluster");
Please sign in to comment.
Something went wrong with that request. Please try again.