Changeset: 6e42cf00001d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6e42cf00001d Modified Files: common/utils/mstring.h gdk/gdk_logger.c gdk/gdk_project.c sql/storage/bat/bat_logger.c sql/storage/store.c Branch: Oct2020 Log Message:
merged jun2020 diffs (73 lines): diff --git a/common/utils/mstring.h b/common/utils/mstring.h --- a/common/utils/mstring.h +++ b/common/utils/mstring.h @@ -29,7 +29,10 @@ strcpy_len(char *restrict dst, const cha if ((dst[i] = src[i]) == 0) return i; } - dst[n - 1] = 0; + /* for correctness, the decrement isn't needed (just assigning 0 + * to dst[n-1] would be sufficient), but to work around a too + * strict GNU C compiler, we do need it */ + dst[--n] = 0; /* in some versions of GCC (at least gcc (Ubuntu 7.5.0-3ubuntu1~18.04) * 7.5.0), the error just can't be turned off when using * --enable-strict, so we just use the (more) expensive way of getting the diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -2460,7 +2460,9 @@ logger_destroy(logger *lg) BUN p, q; BAT *b = lg->catalog_bid; - if (logger_cleanup(lg) != GDK_SUCCEED) + if (lg->changes && + (logger_restart(lg) != GDK_SUCCEED || + logger_cleanup(lg) != GDK_SUCCEED)) TRC_CRITICAL(GDK, "logger_cleanup failed\n"); /* free resources */ diff --git a/sql/storage/bat/bat_logger.c b/sql/storage/bat/bat_logger.c --- a/sql/storage/bat/bat_logger.c +++ b/sql/storage/bat/bat_logger.c @@ -1073,15 +1073,9 @@ bl_destroy(void) { logger *l = bat_logger; + logger_destroy(l); + bat_logger = NULL; - if (l) { - close_stream(l->log); - GDKfree(l->fn); - GDKfree(l->dir); - GDKfree(l->local_dir); - GDKfree(l->buf); - GDKfree(l); - } } static int diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -2310,6 +2310,7 @@ flusher_should_run(void) void store_exit(void) { + int debug = store_debug&128; MT_lock_set(&bs_lock); TRC_DEBUG(SQL_STORE, "Store locked\n"); @@ -2320,6 +2321,11 @@ store_exit(void) MT_sleep_ms(100); MT_lock_set(&bs_lock); } + while (debug && ATOMIC_GET(&store_nr_active)) { /* wait for all to finish */ + MT_lock_unset(&bs_lock); + MT_sleep_ms(100); + MT_lock_set(&bs_lock); + } if (gtrans) { MT_lock_unset(&bs_lock); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list