Changeset: aac92169721e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/aac92169721e
Modified Files:
        gdk/gdk_bbp.c
Branch: default
Log Message:

Better administer the hasfile bit for tstats heaps.


diffs (31 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -612,7 +612,7 @@ heapinit(BAT *b, const char *buf,
                        .farmid = BBPselectfarm(PERSISTENT, b->ttype, 
sketchheap),
                        .role = PERSISTENT,
                        .dirty = false,
-                       .hasfile = free > 0,
+                       .hasfile = false,
                        .storage = STORE_INVALID,
                        .parentid = b->batCacheid,
                };
@@ -3734,7 +3734,8 @@ BBPdestroy(BAT *b)
                HEAPdecref(b->theap, tp == 0);
                b->theap = NULL;
                if (b->tstats) {
-                       HEAPdecref(b->tstats, tp == 0);
+                       HEAPdecref(b->tstats,
+                                  b->tstats->parentid == b->batCacheid);
                        b->tstats = NULL;
                }
                if (tp != 0)
@@ -4806,6 +4807,8 @@ BBPdiskscan(const char *parent, size_t b
                        } else if (strncmp(p + 1, "tstats", 7) == 0) {
                                BAT *b = getdesc(bid);
                                delete = (b == NULL || b->tstats == NULL || 
!b->batCopiedtodisk || b->tstats->free == 0);
+                               if (!delete)
+                                       b->tstats->hasfile = true;
                        } else if (strncmp(p + 1, "thashl", 6) == 0 ||
                                   strncmp(p + 1, "thashb", 6) == 0) {
                                BAT *b = getdesc(bid);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to