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

Set tstats dirty flag next to code where update actually happens.


diffs (70 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1295,6 +1295,7 @@ BUNappendmulti(BAT *b, const void *value
                                        MT_lock_unset(&b->theaplock);
                                        return GDK_FAIL;
                                }
+                               b->tstats->dirty = true;
                                MT_lock_unset(&b->theaplock);
                        }
                } else if (ATOMstorage(b->ttype) == TYPE_msk) {
@@ -1351,6 +1352,7 @@ BUNappendmulti(BAT *b, const void *value
                                        MT_lock_unset(&b->theaplock);
                                        return GDK_FAIL;
                                }
+                               b->tstats->dirty = true;
                                MT_lock_unset(&b->theaplock);
                        }
                }
@@ -2189,8 +2191,6 @@ BATsetcount(BAT *b, BUN cnt)
                b->theap->dirty |= b->ttype != TYPE_void && cnt > 0;
                b->theap->free = tailsize(b, cnt);
        }
-       if (b->tstats)
-               b->tstats->dirty |= cnt > 0;
        if (b->ttype == TYPE_void)
                b->batCapacity = cnt;
        if (cnt <= 1) {
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 = b->theap->hasfile,
+                       .hasfile = free > 0,
                        .storage = STORE_INVALID,
                        .parentid = b->batCacheid,
                };
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -761,13 +761,6 @@ BATsave_iter(BAT *b, BATiter *bi, BUN si
                }
        } else {
                const char *nme = BBP_physical(b->batCacheid);
-               if (bi->sh) {
-                       if ((bi->hdirty || (bi->vh && bi->vhdirty)) && 
!bi->shdirty) { /* TODO make sure we set tstats->dirty correctly */
-                               //assert(0);
-                               bi->shdirty = true;
-                       }
-                       assert(bi->sh->free == TSTATS_SZ);
-               }
                if ((!bi->copiedtodisk || bi->hdirty)
                    && (err == GDK_SUCCEED && bi->type)) {
                        const char *tail = strchr(bi->h->filename, '.') + 1;
@@ -779,9 +772,9 @@ BATsave_iter(BAT *b, BATiter *bi, BUN si
                    && ATOMvarsized(bi->type)
                    && err == GDK_SUCCEED)
                        err = HEAPsave(bi->vh, nme, "theap", dosync, 
bi->vhfree, bi->type == TYPE_msk ? NULL : &b->theaplock);
-               if (err == GDK_SUCCEED
-                   && bi->sh
-                   && (!bi->copiedtodisk || bi->shdirty))
+               if (bi->sh
+                   && (!bi->copiedtodisk || bi->shdirty)
+                   && err == GDK_SUCCEED)
                        err = HEAPsave(bi->sh, nme, "tstats", dosync, 
TSTATS_SZ, &b->theaplock);
        }
 
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to