Changeset: dd20fd7d1070 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dd20fd7d1070
Modified Files:
monetdb5/mal/mal_recycle.c
sql/backends/monet5/sql.mx
sql/backends/monet5/sql_user.c
Branch: default
Log Message:
Remove some debugging, and superflous RECYCLEdrop
diffs (173 lines):
diff --git a/monetdb5/mal/mal_recycle.c b/monetdb5/mal/mal_recycle.c
--- a/monetdb5/mal/mal_recycle.c
+++ b/monetdb5/mal/mal_recycle.c
@@ -300,8 +300,8 @@ static void RECYCLEcleanCache(Client cnt
bte *used;
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#CACHE BEFORE CLEANUP\n");
- RECYCLEdumpInternal(cntxt->fdout);
+ //mnstr_printf(cntxt->fdout,"#CACHE BEFORE CLEANUP
%d\n",recycleCacheLimit);
+ //RECYCLEdumpInternal(cntxt->fdout);
#endif
newpass:
if ( recycleBlk == 0 || recycleBlk->stop == 0)
@@ -342,16 +342,16 @@ newpass:
GDKfree(lmask);
#ifdef _DEBUG_CACHE_
- mnstr_printf(cntxt->fdout,"#RECYCLEcleanCache: usedmem="LLFMT"\n",
recyclerMemoryUsed);
- mnstr_printf(cntxt->fdout,"#Candidates for
eviction\n#LRU\tclk\t\tticks\t\twbytes\tCalls\tProfit\n");
- for (l = 0; l < ltop; l++)
- mnstr_printf(cntxt->fdout,"#%3d\t"LLFMT"\t"LLFMT"\t\t
"LLFMT"\t%3d\t%5.1f\n",
- leaves[l],
- recycleBlk->profiler[leaves[l]].clk,
- recycleBlk->profiler[leaves[l]].ticks,
- recycleBlk->profiler[leaves[l]].wbytes,
- recycleBlk->profiler[leaves[l]].calls,
- recycleProfit2(leaves[l]));
+ //mnstr_printf(cntxt->fdout,"#RECYCLEcleanCache: usedmem="LLFMT"\n",
recyclerMemoryUsed);
+ //mnstr_printf(cntxt->fdout,"#Candidates for
eviction\n#LRU\tclk\t\tticks\t\twbytes\tCalls\tProfit\n");
+ //for (l = 0; l < ltop; l++)
+ //mnstr_printf(cntxt->fdout,"#%3d\t"LLFMT"\t"LLFMT"\t\t
"LLFMT"\t%3d\t%5.1f\n",
+ //leaves[l],
+ //recycleBlk->profiler[leaves[l]].clk,
+ //recycleBlk->profiler[leaves[l]].ticks,
+ //recycleBlk->profiler[leaves[l]].wbytes,
+ //recycleBlk->profiler[leaves[l]].calls,
+ //recycleProfit2(leaves[l]));
#endif
/* find entries to evict */
@@ -1024,8 +1024,8 @@ RECYCLEcolumn(Client cntxt,str sch,str t
MT_lock_set(&recycleLock, "recycle");
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#POOL BEFORE CLEANUP\n");
- RECYCLEdumpInternal(cntxt->fdout);
+ //mnstr_printf(cntxt->fdout,"#POOL BEFORE CLEANUP\n");
+ //RECYCLEdumpInternal(cntxt->fdout);
#endif
release= (char*) GDKzalloc(recycleBlk->vtop);
vr.vtype = TYPE_str;
@@ -1089,8 +1089,8 @@ RECYCLEcolumn(Client cntxt,str sch,str t
freeInstruction(p);
}
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#POOL AFTER CLEANUP\n");
- RECYCLEdumpInternal(cntxt->fdout);
+ //mnstr_printf(cntxt->fdout,"#POOL AFTER CLEANUP\n");
+ //RECYCLEdumpInternal(cntxt->fdout);
#endif
MT_lock_unset(&recycleLock, "recycle");
GDKfree(release);
@@ -1101,7 +1101,7 @@ RECYCLEcolumn(Client cntxt,str sch,str t
str
RECYCLEresetBAT(Client cntxt, int bid)
{
- int i,j;
+ int i,j, actions =0;
char *release;
InstrPtr *old,p;
int limit;
@@ -1109,8 +1109,8 @@ RECYCLEresetBAT(Client cntxt, int bid)
MT_lock_set(&recycleLock, "recycle");
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#POOL BEFORE CLEANUP\n");
- RECYCLEdumpInternal(cntxt->fdout);
+ //mnstr_printf(cntxt->fdout,"#POOL RESET BAT %d\n",bid);
+ //RECYCLEdumpInternal(cntxt->fdout);
#endif
release= (char*) GDKzalloc(recycleBlk->vtop);
limit= recycleBlk->stop;
@@ -1137,7 +1137,7 @@ RECYCLEresetBAT(Client cntxt, int bid)
continue;
}
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#Marked for eviction [%d]",i);
+ mnstr_printf(cntxt->fdout,"#EVICT [%d]",i);
printInstruction(cntxt->fdout,recycleBlk,0,p, LIST_MAL_DEBUG);
#endif
for(j=0;j<p->argc;j++) {
@@ -1147,11 +1147,16 @@ RECYCLEresetBAT(Client cntxt, int bid)
BBPdecref(ABS(v->val.bval), TRUE);
}
}
+ actions++;
freeInstruction(p);
}
#ifdef _DEBUG_RESET_
- mnstr_printf(cntxt->fdout,"#POOL AFTER CLEANUP\n");
- RECYCLEdumpInternal(cntxt->fdout);
+ if( actions){
+ mnstr_printf(cntxt->fdout,"#POOL AFTER CLEANUP\n");
+ RECYCLEdumpInternal(cntxt->fdout);
+ }
+#else
+ (void) actions;
#endif
MT_lock_unset(&recycleLock, "recycle");
GDKfree(release);
diff --git a/sql/backends/monet5/sql.mx b/sql/backends/monet5/sql.mx
--- a/sql/backends/monet5/sql.mx
+++ b/sql/backends/monet5/sql.mx
@@ -1936,7 +1936,7 @@ SQLtransaction(Client cntxt, MalBlkPtr m
case DDL_ROLLBACK:
if (sql->session->auto_commit == 1)
throw(SQL, "sql.trans", "2DM30!ROLLBACK: not allowed in
auto commit mode");
- RECYCLEdrop(0);
+ RECYCLEdrop(cntxt);
ret = mvc_rollback(sql, chain, name);
if (ret < 0 && name) {
snprintf(buf, BUFSIZ, "3B000!ROLLBACK TO SAVEPOINT:
(%s) failed", name);
@@ -1947,7 +1947,7 @@ SQLtransaction(Client cntxt, MalBlkPtr m
if (sql->session->auto_commit == 0)
throw(SQL, "sql.trans", "25001!START TRANSACTION:
cannot start a transaction within a transaction");
if (sql->session->active){
- RECYCLEdrop(0);
+ RECYCLEdrop(cntxt);
mvc_rollback(sql, 0, NULL);
}
sql->session->auto_commit = 0;
@@ -1987,7 +1987,7 @@ SQLabort(Client cntxt, MalBlkPtr mb, Mal
(void) pci;
if (sql->session->active){
- RECYCLEdrop(0);
+ RECYCLEdrop(cntxt);
mvc_rollback(sql, 0, NULL);
}
return msg;
@@ -2004,7 +2004,7 @@ SQLtransaction2(Client cntxt, MalBlkPtr
if (sql->session->auto_commit == 0)
throw(SQL, "sql.trans", "25001!START TRANSACTION: cannot start
a transaction within a transaction");
if (sql->session->active){
- RECYCLEdrop(0);
+ RECYCLEdrop(cntxt);
mvc_rollback(sql, 0, NULL);
}
sql->session->auto_commit = 0;
diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c
--- a/sql/backends/monet5/sql_user.c
+++ b/sql/backends/monet5/sql_user.c
@@ -491,10 +491,8 @@ monet5_user_get_def_schema(mvc *m, oid u
}
if (!schema || !mvc_set_schema(m, schema)) {
- if (m->session->active){
- RECYCLEdrop(0);
+ if (m->session->active)
mvc_rollback(m, 0, NULL);
- }
return NULL;
}
/* reset the user and schema names */
@@ -502,7 +500,6 @@ monet5_user_get_def_schema(mvc *m, oid u
stack_set_string(m, "current_user", username);
stack_set_string(m, "current_role", username);
GDKfree(username);
- RECYCLEdrop(0);
mvc_rollback(m, 0, NULL);
return schema;
}
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list