Changeset: daea8245a12f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/daea8245a12f Modified Files: gdk/ChangeLog.Jan2022 gdk/gdk_bbp.c gdk/gdk_storage.c Branch: Jan2022 Log Message:
Merge with Jul2021 branch. diffs (94 lines): diff --git a/gdk/ChangeLog.Jan2022 b/gdk/ChangeLog.Jan2022 --- a/gdk/ChangeLog.Jan2022 +++ b/gdk/ChangeLog.Jan2022 @@ -1,6 +1,15 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Thu Jul 28 2022 Sjoerd Mullender <[email protected]> +- Fixed an off-by-one error in the logger which caused older log files + to stick around longer in the write-ahead log than necessary. +- When an empty BAT is committed, skip writing (and synchronizing to + disk) the heap (tail and theap) files and write 0 for their sizes to + the BBP.dir file. When reading the BBP.dir file, if an empty BAT is + encountered, set the sizes of those files to 0. This fixes potential + issues during startup of the server (BBPcheckbats reporting errors). + * Wed Jun 22 2022 Sjoerd Mullender <[email protected]> - Make sure heap files of transient bats get deleted when the bat is destroyed. If the bat was a partial view (sharing the vheap but not diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -3275,10 +3275,6 @@ BBPdestroy(BAT *b) bat tp = VIEWtparent(b); bat vtp = VIEWvtparent(b); - HASHdestroy(b); - IMPSdestroy(b); - OIDXdestroy(b); - PROPdestroy_nolock(b); if (tp == 0) { /* bats that get destroyed must unfix their atoms */ gdk_return (*tunfix) (const void *) = BATatoms[b->ttype].atomUnfix; @@ -3295,12 +3291,7 @@ BBPdestroy(BAT *b) } if (tp || vtp) VIEWunlink(b); - if (b->theap) { - HEAPfree(b->theap, true); - } - if (b->tvheap) - HEAPfree(b->tvheap, true); - b->batCopiedtodisk = false; + BATdelete(b); BBPclear(b->batCacheid, true); /* if destroyed; de-register from BBP */ diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c --- a/gdk/gdk_storage.c +++ b/gdk/gdk_storage.c @@ -959,8 +959,11 @@ BATdelete(BAT *b) { bat bid = b->batCacheid; BAT *loaded = BBP_cache(bid); + char o[10]; + char *f; assert(bid > 0); + snprintf(o, sizeof(o), "%o", (unsigned) bid); if (loaded) { b = loaded; } @@ -969,9 +972,29 @@ BATdelete(BAT *b) OIDXdestroy(b); PROPdestroy_nolock(b); STRMPdestroy(b); - HEAPfree(b->theap, true); - if (b->tvheap) + if (b->theap) { + HEAPfree(b->theap, true); + if ((f = GDKfilepath(b->theap->farmid, BAKDIR, o, "tail1")) != NULL) { + MT_remove(f); + size_t i = strlen(f) - 1; + f[i] = '2'; + MT_remove(f); +#if SIZEOF_VAR_T == 8 + f[i] = '4'; + MT_remove(f); +#endif + f[i] = '\0'; + MT_remove(f); + GDKfree(f); + } + } + if (b->tvheap) { HEAPfree(b->tvheap, true); + if ((f = GDKfilepath(b->theap->farmid, BAKDIR, o, "theap")) != NULL) { + MT_remove(f); + GDKfree(f); + } + } b->batCopiedtodisk = false; } _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
