Changeset: 028c8f5ba5e3 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=028c8f5ba5e3
Modified Files:
sql/backends/monet5/sql_wlcr.c
sql/test/wlcr/Tests/wlr20.py
Branch: wlcr
Log Message:
Avoid extra nextbatch upgrades
diffs (63 lines):
diff --git a/sql/backends/monet5/sql_wlcr.c b/sql/backends/monet5/sql_wlcr.c
--- a/sql/backends/monet5/sql_wlcr.c
+++ b/sql/backends/monet5/sql_wlcr.c
@@ -34,7 +34,7 @@ static str wlr_master;
static str wlr_dbname;
static int wlr_nextbatch; // the last log file processed completely
static int wlr_tag; // tag of last record processed
-static lng wlr_threshold; // minimum time for a query to be re-executed
+static int wlr_threshold = -1; // minimum time for a query to be re-executed
static
str WLRgetConfig(void){
@@ -71,7 +71,7 @@ str WLRsetConfig(void){
throw(MAL,"wlr.setConfig","Could not access %s\n",path);
fprintf(fd,"dbname=%s\n", wlr_dbname);
fprintf(fd,"master=%s\n", wlr_master);
- fprintf(fd,"nextbatch=%d\n", ++wlr_nextbatch);
+ fprintf(fd,"nextbatch=%d\n", wlr_nextbatch);
fprintf(fd,"tag=%d\n", wlr_tag);
fclose(fd);
return MAL_SUCCEED;
@@ -171,10 +171,8 @@ WLRgetThreshold( Client cntxt, MalBlkPtr
if ((msg = checkSQLContext(cntxt)) != NULL)
return msg;
a = stack_get_var(m, "replaythreshold");
- if (!a) {
- throw(SQL, "sql.getVariable", "variable 'replaylog' unknown");
- }
- wlr_threshold = a->data.val.ival;
+ if (a)
+ wlr_threshold = a->data.val.ival;
return MAL_SUCCEED;
}
@@ -287,6 +285,8 @@ WLCRprocess(void *arg)
pc = 0;
}
} while( mb->errors == 0 && pc != mb->stop);
+ wlr_nextbatch++;
+ WLRsetConfig();
close_stream(fd);
}
(void) mnstr_flush(c->fdout);
diff --git a/sql/test/wlcr/Tests/wlr20.py b/sql/test/wlcr/Tests/wlr20.py
--- a/sql/test/wlcr/Tests/wlr20.py
+++ b/sql/test/wlcr/Tests/wlr20.py
@@ -2,7 +2,7 @@ try:
from MonetDBtesting import process
except ImportError:
import process
-import os, sys, socket
+import os, sys, socket, time
process.verbose = True
dbfarm = os.getenv('GDK_DBFARM')
@@ -34,6 +34,7 @@ slave = process.server(dbname = dbnamecl
c = process.client('sql', dbname = dbnameclone, port = cloneport, stdin =
process.PIPE, stdout = process.PIPE, stderr = process.PIPE)
+time.sleep(3)
cout, cerr = c.communicate('''\
select * from tmp;
''')
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list