Niels, Sjoerd, Peter, after (quite) some time of debugging for [ 1976341 ] XQ: leftovers after deleting document http://sourceforge.net/tracker/index.php?func=detail&aid=1976341&group_id=56967&atid=482468 I found the --- or at least one possible --- cause for this bug. In pathfinder, newly shredded read-only documents are added to the logger using logger_add_bat() --- let's ignore for the time being, that I am a bit puzzled by this, since I though / was told, pathfinder uses check-pointing instead of the logger (WAL) for shredding documents. Obviously, logger_add_bat() increments the ref-count of the logged BATs (BBPincref()). However, logger_del_bat() does not seem to decrements the ref-count, again, once a BAT is removed from the logger. This way, document BATs keep the logger_add_bat()-increased ref-count even after a pf:del-doc() and stay around until the Mserver is shutdown. The below patch seem to "fix" this problem. However, since I'm everything but familiar with the logger or the usage of it in either XQuery or SQL, I'd rather have you double-check the patch before I'd check it in. (Of course I'll also run "private" testing of the whole suite overnight to see whether my patch causes any (obvious) harm. Thank you very much in advance! Stefan ======== Index: MonetDB/src/gdk/gdk_logger.mx =================================================================== RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_logger.mx,v retrieving revision 1.17.2.1 diff -u -r1.17.2.1 gdk_logger.mx --- MonetDB/src/gdk/gdk_logger.mx 27 May 2008 20:33:39 -0000 1.17.2.1 +++ MonetDB/src/gdk/gdk_logger.mx 3 Jun 2008 23:27:15 -0000 @@ -1721,6 +1721,7 @@ void logger_del_bat(logger *lg, log_bid bid) { + BBPdecref(bid, TRUE); BUNdelHead(lg->catalog, &bid, FALSE); } ======== -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4312 |