File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -120,3 +120,6 @@ This file describes the main feature changes for each InfoLogger released versio
120120
121121## v2.4.3 - 01/02/2022
122122- infoBrowser configuration: added parameter "queryLimit" to change the maximum number of messages returned by a query. Default is 10000.
123+
124+ ## v2.4.4 - 09/05/2022
125+ - changed algorithm of DB threads message distribution, now based on timestamp to help keeping multi-line split messages in same order.
Original file line number Diff line number Diff line change 1717#include " infoLoggerMessageDecode.h"
1818#include " InfoLoggerMessageList.h"
1919#include " InfoLoggerDispatch.h"
20+ #include " InfoLoggerMessageHelper.h"
2021
2122#include " ConfigInfoLoggerServer.h"
2223
@@ -214,6 +215,13 @@ Daemon::LoopStatus InfoLoggerServer::doLoop()
214215 unsigned int nThreads = dispatchEnginesDB.size ();
215216 unsigned int nTry = 1 ;
216217 int pushOk = 0 ;
218+
219+ // distribute message based on timestamp
220+ // to try keeping messages inserted in same order when parallel insert
221+ InfoLoggerMessageHelper h;
222+ unsigned char * tptr= (unsigned char *) &msgList->msg ->values [h.ix_timestamp ].value .vDouble ;
223+ dbRoundRobinIx = (tptr[0 ] + tptr[1 ] + tptr[2 ] + tptr[3 ] + tptr[4 ] + tptr[5 ] + tptr[6 ] + tptr[7 ]) % nThreads;
224+
217225 for (; nTry <= nThreads * 3 ; nTry++) {
218226 int err = dispatchEnginesDB[dbRoundRobinIx]->pushMessage (msgList);
219227 dbRoundRobinIx++;
You can’t perform that action at this time.
0 commit comments