Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

initial broker pairing algo

  • Loading branch information...
commit 660891df7a68159fb54ff951cd194c4ef2215458 1 parent 070d38b
root authored

Showing 2 changed files with 28 additions and 2 deletions. Show diff stats Hide diff stats

  1. +0 1  cluster/handlers-state.c
  2. +28 1 cluster/handlers.c
1  cluster/handlers-state.c
@@ -116,7 +116,6 @@ int doDescribeServices(ncMetadata *ccMeta, serviceInfoType *serviceIds, int serv
116 116 }
117 117 */
118 118 sem_mywait(CONFIG);
119   - logprintfl(EUCADEBUG, "MEH: %s\n", config->ccStatus.serviceId.name);
120 119 if (!strcmp(config->ccStatus.serviceId.name, "self")) {
121 120 for (i=0; i<serviceIdsLen; i++) {
122 121 logprintfl(EUCADEBUG, "DescribeServices(): received input serviceId[%d]\n", i);
29 cluster/handlers.c
@@ -2813,6 +2813,8 @@ int ccCheckState() {
2813 2813 char localDetails[1024];
2814 2814 int ret=0;
2815 2815 char cmd[MAX_PATH];
  2816 + char buri[MAX_PATH], uriType[32], bhost[MAX_PATH], path[MAX_PATH], curi[MAX_PATH], chost[MAX_PATH];
  2817 + int port, done=0, i, j, rc;
2816 2818
2817 2819 if (!config) {
2818 2820 return(1);
@@ -2857,6 +2859,31 @@ int ccCheckState() {
2857 2859
2858 2860 // network
2859 2861
  2862 + // broker pairing algo
  2863 + for (i=0; i<16; i++) {
  2864 + int j;
  2865 + if (strlen(config->notreadyServices[i].type)) {
  2866 + if (!strcmp(config->notreadyServices[i].type, "vmwarebroker")) {
  2867 + for (j=0; j<8; j++) {
  2868 + if (strlen(config->notreadyServices[i].uris[j])) {
  2869 + logprintfl(EUCADEBUG, "ccCheckState(): found broker - %s\n", config->notreadyServices[i].uris[j]);
  2870 +
  2871 + snprintf(buri, MAX_PATH, "%s", config->notreadyServices[i].uris[j]);
  2872 + bzero(bhost, sizeof(char) * MAX_PATH);
  2873 + rc = tokenize_uri(buri, uriType, bhost, &port, path);
  2874 +
  2875 + snprintf(curi, MAX_PATH, "%s", config->ccStatus.serviceId.uris[0]);
  2876 + bzero(chost, sizeof(char) * MAX_PATH);
  2877 + rc = tokenize_uri(curi, uriType, chost, &port, path);
  2878 + if (!strcmp(curi, buri)) {
  2879 + logprintfl(EUCAWARN, "ccCheckState(): detected local broker in not ready state\n");
  2880 + }
  2881 + }
  2882 + }
  2883 + }
  2884 + }
  2885 + }
  2886 +
2860 2887 snprintf(localDetails, 1023, "ERRORS=%d", ret);
2861 2888 sem_mywait(CONFIG);
2862 2889 snprintf(config->ccStatus.details, 1023, "%s", localDetails);
@@ -3760,7 +3787,7 @@ int init_config(void) {
3760 3787 config->ncFanout = ncFanout;
3761 3788 locks[REFRESHLOCK] = sem_open("/eucalyptusCCrefreshLock", O_CREAT, 0644, config->ncFanout);
3762 3789 config->initialized = 1;
3763   - ccChangeState(LOADED);
  3790 + ccChangeState(NOTREADY);
3764 3791 config->ccStatus.localEpoch = 0;
3765 3792 snprintf(config->ccStatus.details, 1024, "ERRORS=0");
3766 3793 snprintf(config->ccStatus.serviceId.type, 32, "cluster");

0 comments on commit 660891d

Please sign in to comment.
Something went wrong with that request. Please try again.