Changeset: f06ea70c5567 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f06ea70c5567
Modified Files:
        sql/backends/monet5/wlr.c
        sql/test/wlcr/Tests/wlc100.stable.err
        sql/test/wlcr/Tests/wlc100.stable.out
        sql/test/wlcr/Tests/wlr100.stable.err
        sql/test/wlcr/Tests/wlr100.stable.out
Branch: wlcr
Log Message:

Limit replay based on timestamp


diffs (109 lines):

diff --git a/sql/backends/monet5/wlr.c b/sql/backends/monet5/wlr.c
--- a/sql/backends/monet5/wlr.c
+++ b/sql/backends/monet5/wlr.c
@@ -74,7 +74,7 @@ WLRgetConfig(void){
         if( strncmp("limit=", line, 6) == 0)
             wlr_limit = atol(line+ 6);
         if( strncmp("timelimit=", line, 10) == 0)
-            strncpy(wlr_master, line + 10, 26);
+            strcpy(wlr_timelimit, line + 10);
         if( strncmp("error=", line, 6) == 0)
             strncpy(wlr_error, line+ 6, PATHLENGTH);
     }
@@ -212,7 +212,7 @@ WLRprocess(void *arg)
 
                c->yycur = 0;
                mnstr_printf(cntxt->fdout,"#replay log file:%s\n",path);
-               //
+
                // now parse the file line by line to reconstruct the WLR blocks
                do{
                        pc = mb->stop;
@@ -230,7 +230,7 @@ WLRprocess(void *arg)
                        } else
                        if( getModuleId(q) == wlrRef && getFunctionId(q) == 
transactionRef && 
                                ( ( (currid = getVarConstant(mb, 
getArg(q,1)).val.lval) >= wlr_limit && wlr_limit != -1) ||
-                               ( wlr_timelimit[0] && strcmp(getVarConstant(mb, 
getArg(q,1)).val.sval, wlr_timelimit) >= 0))
+                               ( wlr_timelimit[0] && strcmp(getVarConstant(mb, 
getArg(q,2)).val.sval, wlr_timelimit) >= 0))
                                ){
                                /* stop execution of the transactions if your 
reached the limit */
                                resetMalBlk(mb, 1);
@@ -298,8 +298,8 @@ WLRprocess(void *arg)
                // skip to next file when all is read
                wlr_batches++;
                WLRsetConfig();
-               // stop when we are about to read the limited transaction
-               if(wlr_limit != -1 && wlr_limit <= wlr_tag)
+               // stop when we are about to read beyond the limited 
transaction (timestamp)
+               if( (wlr_limit != -1 || (wlr_timelimit[0] && wlr_read[0] && 
strncmp(wlr_read,wlr_timelimit,26)>= 0) )  && wlr_limit <= wlr_tag)
                        break;
        }
 wrapup:
@@ -318,6 +318,10 @@ static void
 WLRprocessScheduler(void *arg)
 {      Client cntxt = (Client) arg;
        int duration;
+       struct timeval clock;
+       time_t clk;
+       struct tm ctm;
+       char clktxt[26];
 
        WLRgetConfig();
        wlr_state = WLR_RUN;
@@ -325,13 +329,19 @@ WLRprocessScheduler(void *arg)
                // wait at most for the cycle period, also at start
                //mnstr_printf(cntxt->fdout,"#sleep %d ms\n",(wlc_beat? 
wlc_beat:1) * 1000);
                duration = (wlc_beat? wlc_beat:1) * 1000 ;
+               gettimeofday(&clock, NULL);
+               clk = clock.tv_sec;
+               ctm = *localtime(&clk);
+               strftime(clktxt, 26, "%Y-%m-%d %H:%M:%S.000",&ctm);
+               mnstr_printf(cntxt->fdout,"#now %s tlimit %s\n",clktxt, 
wlr_timelimit);
                for( ; duration > 0 && wlr_state == WLR_PAUSE; duration -= 100)
                        MT_sleep_ms( 100);
                if( wlr_master[0] && wlr_state != WLR_PAUSE){
                        WLRgetMaster();
                        if( wlrprocessrunning == 0 && 
                                ( (wlr_batches == wlc_batches && wlr_tag < 
wlr_limit) || wlr_limit > wlr_tag  ||
-                                 (wlr_limit == -1 && wlr_batches < 
wlc_batches) ) )
+                                 (wlr_limit == -1 && wlr_timelimit[0] == 0 && 
wlr_batches < wlc_batches) ||
+                                 (wlr_timelimit[0]  && 
strncmp(clktxt,wlr_timelimit,26)>= 0)  ) )
                                        WLRprocess(cntxt);
                }
        }
diff --git a/sql/test/wlcr/Tests/wlc100.stable.err 
b/sql/test/wlcr/Tests/wlc100.stable.err
--- a/sql/test/wlcr/Tests/wlc100.stable.err
+++ b/sql/test/wlcr/Tests/wlc100.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'wlc80` in directory 'sql/test/wlcr` itself:
+stderr of test 'wlc100` in directory 'sql/test/wlcr` itself:
 
 
 # 21:26:01 >  
diff --git a/sql/test/wlcr/Tests/wlc100.stable.out 
b/sql/test/wlcr/Tests/wlc100.stable.out
--- a/sql/test/wlcr/Tests/wlc100.stable.out
+++ b/sql/test/wlcr/Tests/wlc100.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'wlc80` in directory 'sql/test/wlcr` itself:
+stdout of test 'wlc100` in directory 'sql/test/wlcr` itself:
 
 
 # 21:26:01 >  
diff --git a/sql/test/wlcr/Tests/wlr100.stable.err 
b/sql/test/wlcr/Tests/wlr100.stable.err
--- a/sql/test/wlcr/Tests/wlr100.stable.err
+++ b/sql/test/wlcr/Tests/wlr100.stable.err
@@ -1,4 +1,4 @@
-stderr of test 'wlr80` in directory 'sql/test/wlcr` itself:
+stderr of test 'wlr100` in directory 'sql/test/wlcr` itself:
 
 
 # 21:26:02 >  
diff --git a/sql/test/wlcr/Tests/wlr100.stable.out 
b/sql/test/wlcr/Tests/wlr100.stable.out
--- a/sql/test/wlcr/Tests/wlr100.stable.out
+++ b/sql/test/wlcr/Tests/wlr100.stable.out
@@ -1,4 +1,4 @@
-stdout of test 'wlr80` in directory 'sql/test/wlcr` itself:
+stdout of test 'wlr100` in directory 'sql/test/wlcr` itself:
 
 
 # 21:26:02 >  
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to