From 4f6d141a8fe40b2884d04b5277f114478466ca5a Mon Sep 17 00:00:00 2001 From: davidbuckley123 <166718222+davidbuckley123@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:25:05 +0100 Subject: [PATCH 1/4] Update kxdash.q --- code/gateway/kxdash.q | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/gateway/kxdash.q b/code/gateway/kxdash.q index be9f60e29..b0bf30d11 100644 --- a/code/gateway/kxdash.q +++ b/code/gateway/kxdash.q @@ -6,7 +6,7 @@ dashparams:`o`w`r`limit!(0;0i;0i;0W) // function to be called from the dashboards dashexec:{[q;s;j] - .gw.asyncexecjpt[(dashremote;q;dashparams);(),s;dashjoin[j];();0Wn] + .gw.syncexecj[q;(),s;j] } // execute the request @@ -31,7 +31,6 @@ dashps:{ [dashparams::`o`w`r`limit!(last value x 1;x 2;x 3;x[4;0]); // execute the query part, which must look something like // .kxdash.dashexec["select from t";`rdb`hdb;raze] - value x[4;1]; ]; // value x] @@ -42,6 +41,9 @@ dashps:{ // reformat those responses to look the same formatresponse:{[status;sync;result] if[`kxdash~first result; + .test.status:status; + .test.sync:sync; + .test.result:result; res:last result; :$[res`status; (`.dash.rcv_msg;res`w;res`o;res`r;res`result); @@ -57,5 +59,5 @@ init:{ // incorporate dashps into the .z.ps definition .dotz.set[`.z.ps;{x@y;.kxdash.dashps y}@[value;.dotz.getcommand[`.z.ps];{{value x}}]]; }; - + if[enabled;init[]]; From f456e5877141d028855a04aa96000b198bde9613 Mon Sep 17 00:00:00 2001 From: davidbuckley123 <166718222+davidbuckley123@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:26:01 +0100 Subject: [PATCH 2/4] Update gateway.q --- code/processes/gateway.q | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/processes/gateway.q b/code/processes/gateway.q index 6d2e04531..f9e65e52d 100644 --- a/code/processes/gateway.q +++ b/code/processes/gateway.q @@ -421,7 +421,7 @@ asyncexec:asyncexecjpt[;;raze;();0Wn] // execute a synchronous query syncexecjpre36:{[query;servertype;joinfunction] // Check correct function called - if[(.z.w<>0)&(.z.w in key .gw.call)¬ .gw.call .z.w; + if[(.z.w<>0)&(.z.w in key .gw.call)&(not .gw.call .z.w)& not @[value;`.kxdash.enabled;0b]; @[neg .z.w;.gw.formatresponse[0b;0b;"Incorrect function used: asyncexec"];()]; :(); ]; From eb493459eda69ebed4197b7aef1e215805d26abc Mon Sep 17 00:00:00 2001 From: davidbuckley123 <166718222+davidbuckley123@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:32:44 +0100 Subject: [PATCH 3/4] Update kxdash.q removing testing lines --- code/gateway/kxdash.q | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/gateway/kxdash.q b/code/gateway/kxdash.q index b0bf30d11..58a3fd2c2 100644 --- a/code/gateway/kxdash.q +++ b/code/gateway/kxdash.q @@ -41,9 +41,6 @@ dashps:{ // reformat those responses to look the same formatresponse:{[status;sync;result] if[`kxdash~first result; - .test.status:status; - .test.sync:sync; - .test.result:result; res:last result; :$[res`status; (`.dash.rcv_msg;res`w;res`o;res`r;res`result); From d159c2510650dcccb7f248e8e58e29554023fd23 Mon Sep 17 00:00:00 2001 From: davidbuckley123 <166718222+davidbuckley123@users.noreply.github.com> Date: Tue, 30 Apr 2024 10:54:13 +0100 Subject: [PATCH 4/4] Update .kxdash.dashps from kxdash.q .gw.asyncexecjpt now only returning 1 result (not 1 from each hdb) --- code/gateway/kxdash.q | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/code/gateway/kxdash.q b/code/gateway/kxdash.q index 58a3fd2c2..3f481eb33 100644 --- a/code/gateway/kxdash.q +++ b/code/gateway/kxdash.q @@ -24,17 +24,13 @@ dashjoin:{[joinfunc;r] (`.dash.snd_err;r[0;1;`w];r[0;1;`r];r[0;1;`result])] } +// this function is to be inserted into .z.ps to set the .kxdash.dashparams variable dashps:{ // check the query coming in meets the format - $[@[{`f`w`r`x`u~first 1_ value first x};x;0b]; + if[@[{`f`w`r`x`u~first 1_ value first x};x;0b]; // pull out the values we need to return to the dashboards - [dashparams::`o`w`r`limit!(last value x 1;x 2;x 3;x[4;0]); - // execute the query part, which must look something like - // .kxdash.dashexec["select from t";`rdb`hdb;raze] - ]; - // - value x] - } + dashparams::`o`w`r`limit!(last value x 1;x 2;x 3;x[4;0])]; + }; // need this to handle queries that only hit one backend process