|
|
@ -6779,7 +6779,7 @@ static bool test_and_clear(bool *val, mutex_t *lock) |
|
|
|
static void ckdbq_process(ckpool_t *ckp, char *msg) |
|
|
|
static void ckdbq_process(ckpool_t *ckp, char *msg) |
|
|
|
{ |
|
|
|
{ |
|
|
|
sdata_t *sdata = ckp->sdata; |
|
|
|
sdata_t *sdata = ckp->sdata; |
|
|
|
size_t responselen; |
|
|
|
size_t responselen = 0; |
|
|
|
char *buf = NULL; |
|
|
|
char *buf = NULL; |
|
|
|
|
|
|
|
|
|
|
|
while (!buf) { |
|
|
|
while (!buf) { |
|
|
@ -6799,15 +6799,16 @@ static void ckdbq_process(ckpool_t *ckp, char *msg) |
|
|
|
|
|
|
|
|
|
|
|
/* Process any requests from ckdb that are heartbeat responses with
|
|
|
|
/* Process any requests from ckdb that are heartbeat responses with
|
|
|
|
* specific requests. */ |
|
|
|
* specific requests. */ |
|
|
|
responselen = strlen(buf); |
|
|
|
if (likely(buf)) |
|
|
|
if (likely(responselen > 1)) { |
|
|
|
responselen = strlen(buf); |
|
|
|
|
|
|
|
if (likely(responselen > 0)) { |
|
|
|
char *response = alloca(responselen); |
|
|
|
char *response = alloca(responselen); |
|
|
|
int offset = 0; |
|
|
|
int offset = 0; |
|
|
|
|
|
|
|
|
|
|
|
memset(response, 0, responselen); |
|
|
|
memset(response, 0, responselen); |
|
|
|
if (likely(sscanf(buf, "%*d.%*d.%c%n", response, &offset) > 0)) { |
|
|
|
if (sscanf(buf, "%*d.%*d.%c%n", response, &offset) > 0) { |
|
|
|
strcpy(response + 1, buf + offset); |
|
|
|
strcpy(response+1, buf+offset); |
|
|
|
if (likely(safecmp(response, "ok"))) { |
|
|
|
if (safecmp(response, "ok")) { |
|
|
|
char *cmd; |
|
|
|
char *cmd; |
|
|
|
|
|
|
|
|
|
|
|
cmd = response; |
|
|
|
cmd = response; |
|
|
@ -6821,8 +6822,8 @@ static void ckdbq_process(ckpool_t *ckp, char *msg) |
|
|
|
LOGWARNING("Got ckdb failure response: %s", buf); |
|
|
|
LOGWARNING("Got ckdb failure response: %s", buf); |
|
|
|
} else |
|
|
|
} else |
|
|
|
LOGWARNING("Got bad ckdb response: %s", buf); |
|
|
|
LOGWARNING("Got bad ckdb response: %s", buf); |
|
|
|
|
|
|
|
free(buf); |
|
|
|
} |
|
|
|
} |
|
|
|
free(buf); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int transactions_by_jobid(sdata_t *sdata, const int64_t id) |
|
|
|
static int transactions_by_jobid(sdata_t *sdata, const int64_t id) |
|
|
|