Changeset: 66108cea57bd for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/66108cea57bd Branch: txtsim-imp Log Message:
Merge with Jun2023. diffs (truncated from 4720 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -799,3 +799,5 @@ bb95192134c0d8ef8fea525204eefcd0de099a54 24385ee6130494440e09d31ec73f4aa2e2893e98 Jul2021_33 05b3d9ea9165baf1d2956d5b06ad85f817ecc6d2 Jul2021_33 05b3d9ea9165baf1d2956d5b06ad85f817ecc6d2 Jul2021_SP10_release +ed34ab4283cbfcc57fb9d7387bc9d781c91902b1 Jan2022_27 +ed34ab4283cbfcc57fb9d7387bc9d781c91902b1 Jan2022_SP7_release diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -432,6 +432,7 @@ install it. Summary: Integration of MonetDB and Python, allowing use of Python from within SQL Group: Applications/Databases Requires: MonetDB5-server%{?_isa} = %{version}-%{release} +Requires: python3-numpy %description python3 MonetDB is a database management system that is developed from a diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -121,7 +121,7 @@ SQLhelp sqlhelp1[] = { "See also https://www.monetdb.org/documentation/user-guide/sql-manual/data-loading/export_data/"}, {"COPY INTO BINARY", "Write query result data to binary files", - "COPY query_expression INTO [{{BIG | LITTLE | NATIVE}} ENDIAN] BINARY string_commalist [ON { CLIENT | SERVER }]", + "COPY query_expression INTO [{BIG | LITTLE | NATIVE} ENDIAN] BINARY string_commalist [ON { CLIENT | SERVER }]", "query_expression", "See also https://www.monetdb.org/documentation/user-guide/sql-manual/data-loading/export_data/"}, {"COPY INTO FROM", diff --git a/gdk/ChangeLog.Sep2022 b/gdk/ChangeLog.Sep2022 --- a/gdk/ChangeLog.Sep2022 +++ b/gdk/ChangeLog.Sep2022 @@ -1,6 +1,11 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Tue May 16 2023 Sjoerd Mullender <sjo...@acm.org> +- Warnings and informational messages are now sent to stdout instead of + stderr, which means that monetdbd will now log them with the tag MSG + instead of ERR. + * Tue Apr 25 2023 Sjoerd Mullender <sjo...@acm.org> - Fixed parsing of the BBP.dir file when BAT ids grow larger than 2**24 (i.e. 100000000 in octal). diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -268,40 +268,6 @@ static volatile MT_Id locked_by = 0; static int BBPunloadCnt = 0; static MT_Lock GDKunloadLock = MT_LOCK_INITIALIZER(GDKunloadLock); -/* GDKtmLock protects all accesses and changes to BAKDIR and SUBDIR - * must use BBPtmlock()/BBPtmunlock() to set/unset the lock */ -static MT_Lock GDKtmLock = MT_LOCK_INITIALIZER(GDKtmLock); -static char *lockfile; -static int lockfd; - -void -BBPtmlock(void) -{ - MT_lock_set(&GDKtmLock); - if (GDKinmemory(0)) - return; - /* also use an external lock file to synchronize with external - * programs */ - if (lockfile == NULL) { - lockfile = GDKfilepath(0, NULL, ".tm_lock", NULL); - if (lockfile == NULL) - return; - } - lockfd = MT_lockf(lockfile, F_LOCK); -} - -void -BBPtmunlock(void) -{ - if (lockfile && lockfd >= 0) { - assert(!GDKinmemory(0)); - MT_lockf(lockfile, F_ULOCK); - close(lockfd); - lockfd = -1; - } - MT_lock_unset(&GDKtmLock); -} - void BBPlock(void) { @@ -397,9 +363,9 @@ recover_dir(int farmid, bool direxists) if (direxists) { /* just try; don't care about these non-vital files */ if (GDKunlink(farmid, BATDIR, "BBP", "bak") != GDK_SUCCEED) - TRC_WARNING(GDK, "unlink of BBP.bak failed\n"); + GDKwarning("unlink of BBP.bak failed\n"); if (GDKmove(farmid, BATDIR, "BBP", "dir", BATDIR, "BBP", "bak", false) != GDK_SUCCEED) - TRC_WARNING(GDK, "rename of BBP.dir to BBP.bak failed\n"); + GDKwarning("rename of BBP.dir to BBP.bak failed\n"); } return GDKmove(farmid, BAKDIR, "BBP", "dir", BATDIR, "BBP", "dir", true); } @@ -520,7 +486,7 @@ heapinit(BAT *b, const char *buf, } if (strcmp(type, "wkba") == 0) - TRC_WARNING(GDK, "type wkba (SQL name: GeometryA) is deprecated\n"); + GDKwarning("type wkba (SQL name: GeometryA) is deprecated\n"); if (properties & ~0x0F81) { TRC_CRITICAL(GDK, "unknown properties are set: incompatible database on line %d of BBP.dir\n", lineno); @@ -1476,7 +1442,7 @@ movestrbats(void) GDKerror("both %s and %s exist with %s unexpectedly newer: manual intervention required\n", oldpath, newpath, oldpath); ret = -1; } else { - TRC_WARNING(GDK, "both %s and %s exist, removing %s\n", oldpath, newpath, oldpath); + GDKwarning("both %s and %s exist, removing %s\n", oldpath, newpath, oldpath); ret = MT_remove(oldpath); } } else { @@ -1510,7 +1476,7 @@ BBPtrim(bool aggressive) flag |= BBPHOT; for (bat bid = 1, nbat = (bat) ATOMIC_GET(&BBPsize); bid < nbat; bid++) { /* don't do this during a (sub)commit */ - MT_lock_set(&GDKtmLock); + BBPtmlock(); MT_lock_set(&GDKswapLock(bid)); BAT *b = NULL; bool swap = false; @@ -1536,7 +1502,7 @@ BBPtrim(bool aggressive) GDKerror("unload failed for bat %d", bid); n++; } - MT_lock_unset(&GDKtmLock); + BBPtmunlock(); } TRC_DEBUG(BAT_, "unloaded %d bats%s\n", n, aggressive ? " (also hot)" : ""); } @@ -3284,8 +3250,8 @@ BBPquickdesc(bat bid) const char *aname = ATOMunknown_name(b->ttype); int tt = ATOMindex(aname); if (tt < 0) { - TRC_WARNING(GDK, "atom '%s' unknown in bat '%s'.\n", - aname, BBP_physical(bid)); + GDKwarning("atom '%s' unknown in bat '%s'.\n", + aname, BBP_physical(bid)); } else { b->ttype = tt; } @@ -4532,3 +4498,40 @@ BBPcallbacks(void) } MT_lock_unset(&GDKCallbackListLock); } + +/* GDKtmLock protects all accesses and changes to BAKDIR and SUBDIR. + * MUST use BBPtmlock()/BBPtmunlock() to set/unset the lock. + * + * This is at the end of the file on purpose: we don't want people to + * accidentally use GDKtmLock directly. */ +static MT_Lock GDKtmLock = MT_LOCK_INITIALIZER(GDKtmLock); +static char *lockfile; +static int lockfd; + +void +BBPtmlock(void) +{ + MT_lock_set(&GDKtmLock); + if (GDKinmemory(0)) + return; + /* also use an external lock file to synchronize with external + * programs */ + if (lockfile == NULL) { + lockfile = GDKfilepath(0, NULL, ".tm_lock", NULL); + if (lockfile == NULL) + return; + } + lockfd = MT_lockf(lockfile, F_LOCK); +} + +void +BBPtmunlock(void) +{ + if (lockfile && lockfd >= 0) { + assert(!GDKinmemory(0)); + MT_lockf(lockfile, F_ULOCK); + close(lockfd); + lockfd = -1; + } + MT_lock_unset(&GDKtmLock); +} diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -754,8 +754,7 @@ la_bat_destroy(logger *lg, logaction *la if (bid < 0) return GDK_FAIL; if (!bid) { - GDKerror("la_bat_destroy failed to find bid for object %d (issue ignored)\n", la->cid); - GDKclrerr(); + GDKwarning("failed to find bid for object %d\n", la->cid); return GDK_SUCCEED; } if (bid && log_del_bat(lg, bid) != GDK_SUCCEED) @@ -1530,7 +1529,7 @@ cleanup_and_swap(logger *lg, int *r, con if ((lb = BATdescriptor(bids[pos])) == NULL || BATmode(lb, true/*transient*/) != GDK_SUCCEED) { - TRC_WARNING(GDK, "Failed to set bat(%d) transient\n", bids[pos]); + GDKwarning("Failed to set bat(%d) transient\n", bids[pos]); } logbat_destroy(lb); } @@ -1820,8 +1819,8 @@ log_cleanup(logger *lg, lng id) return GDK_FAIL; } if (GDKunlink(0, lg->dir, LOGFILE, log_id) != GDK_SUCCEED) { - TRC_WARNING(GDK, "#log_cleanup: failed to remove old WAL %s.%s\n", LOGFILE, log_id); - GDKclrerr(); + GDKwarning("failed to remove old WAL %s.%s\n", LOGFILE, log_id); + GDKclrerr(); /* clear error from unlink */ } return GDK_SUCCEED; } @@ -3079,7 +3078,7 @@ bm_commit(logger *lg) assert(bid); if ((lb = BATdescriptor(bid)) == NULL || BATmode(lb, false) != GDK_SUCCEED) { - TRC_WARNING(GDK, "Failed to set bat (%d%s) persistent\n", bid, !lb?" gone":""); + GDKwarning("Failed to set bat (%d%s) persistent\n", bid, !lb?" gone":""); logbat_destroy(lb); log_unlock(lg); return GDK_FAIL; diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c --- a/gdk/gdk_posix.c +++ b/gdk/gdk_posix.c @@ -396,7 +396,7 @@ MT_mremap(const char *path, int mode, vo return old_address; } if (path && truncate(path, *new_size) < 0) - TRC_WARNING(GDK, "MT_mremap(%s): truncate failed: %s\n", + GDKwarning("truncate of %s failed: %s\n", path, GDKstrerror(errno, (char[64]){0}, 64)); #endif /* !__COVERITY__ */ return old_address; diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h --- a/gdk/gdk_private.h +++ b/gdk/gdk_private.h @@ -176,6 +176,9 @@ gdk_return GDKtracer_init(const char *db __attribute__((__visibility__("hidden"))); gdk_return GDKunlink(int farmid, const char *dir, const char *nme, const char *extension) __attribute__((__visibility__("hidden"))); +#define GDKwarning(format, ...) \ + GDKtracer_log(__FILE__, __func__, __LINE__, M_WARNING, \ + GDK, NULL, format, ##__VA_ARGS__) BUN HASHappend(BAT *b, BUN i, const void *v) __attribute__((__visibility__("hidden"))); void HASHappend_locked(BAT *b, BUN i, const void *v) diff --git a/gdk/gdk_tm.c b/gdk/gdk_tm.c --- a/gdk/gdk_tm.c +++ b/gdk/gdk_tm.c @@ -78,7 +78,7 @@ epilogue(int cnt, bat *subcommit, bool l /* check mmap modes */ MT_lock_set(&b->theaplock); if (BATcheckmodes(b, true) != GDK_SUCCEED) - TRC_WARNING(GDK, "BATcheckmodes failed\n"); + GDKwarning("BATcheckmodes failed\n"); MT_lock_unset(&b->theaplock); } } diff --git a/gdk/gdk_tracer.c b/gdk/gdk_tracer.c --- a/gdk/gdk_tracer.c +++ b/gdk/gdk_tracer.c @@ -291,19 +291,27 @@ find_component(const char *comp) * API CALLS * */ +static volatile sig_atomic_t interrupted = 0; + void GDKtracer_reinit_basic(int sig) { (void) sig; + interrupted = 1; +} + +static void +reinit(void) +{ + /* called locked */ + + interrupted = 0; // GDKtracer needs to reopen the file only in // case the adapter is BASIC if ((adapter_t) ATOMIC_GET(&cur_adapter) != BASIC) return; - // Make sure that GDKtracer is not trying to flush the buffer - MT_lock_set(&GDKtracer_lock); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org