Changeset: b63d12cd8bab for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b63d12cd8bab
Modified Files:
gdk/gdk_logger.c
testing/Mtest.py.in
Branch: transaction-replication
Log Message:
Merge with default branch
Manual merge updated 32->64 bit upgrade code
diffs (148 lines):
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -258,10 +258,11 @@ la_bat_clear(logger *lg, logaction *la)
static int
log_read_seq(logger *lg, logformat *l)
{
- lng seq = l->nr;
+ int seq = (int) l->nr;
lng val;
BUN p;
+ assert(l->nr <= (lng) INT_MAX);
if (mnstr_readLng(lg->log, &val) != 1) {
fprintf(stderr, "!ERROR: log_read_seq: read failed\n");
return LOG_ERR;
@@ -1474,28 +1475,37 @@ logger_load(int debug, char* fn, char fi
curid = -1; /* shouldn't happen? */
fseek(fp, off, SEEK_SET);
- if ((fp1 = fopen(bak, "r")) != NULL) {
- /* file indicating that we need to do
- * a 32->64 bit OID conversion exists;
- * record the fact in case we get
- * interrupted, and set the flag so
- * that we actually do what's asked */
- fclose(fp1);
- /* first create a versioned file using
- * the current log id */
- fp1 = fopen(cvfile, "w");
- fprintf(fp1, "%d\n", curid);
- fclose(fp1);
- /* then remove the unversioned file
- * that gdk_bbp created (in this
- * order!) */
- unlink(bak);
- /* set the flag that we need to convert
*/
- lg->read32bitoid = 1;
- } else if ((fp1 = fopen(cvfile, "r")) != NULL) {
- /* the versioned conversion file
- * exists: check version */
- int newid;
+ if ((fp1 = fopen(bak, "r")) != NULL) {
+ /* file indicating that we need to do
+ * a 32->64 bit OID conversion exists;
+ * record the fact in case we get
+ * interrupted, and set the flag so
+ * that we actually do what's asked */
+ fclose(fp1);
+ /* first create a versioned file using
+ * the current log id */
+ if ((fp1 = fopen(cvfile, "w")) == NULL ||
+ fprintf(fp1, "%d\n", curid) < 2 ||
+ fflush(fp1) != 0 || /* make sure it's save
on disk */
+#if defined(_MSC_VER)
+ _commit(_fileno(fp1)) < 0 ||
+#elif defined(HAVE_FDATASYNC)
+ fdatasync(fileno(fp1)) < 0 ||
+#elif defined(HAVE_FSYNC)
+ fsync(fileno(fp1)) < 0 ||
+#endif
+ fclose(fp1) != 0)
+ logger_fatal("Logger_new: failed to
write %s\n", cvfile, 0, 0);
+ /* then remove the unversioned file
+ * that gdk_bbp created (in this
+ * order!) */
+ unlink(bak);
+ /* set the flag that we need to convert */
+ lg->read32bitoid = 1;
+ } else if ((fp1 = fopen(cvfile, "r")) != NULL) {
+ /* the versioned conversion file
+ * exists: check version */
+ int newid;
if (fscanf(fp1, "%d", &newid) == 1 &&
newid == curid) {
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2084,6 +2084,8 @@ def RunTest(env, TST, BusyPorts, COND, o
errcode = F_SEGV
elif tres == 'abort':
errcode = F_ABRT
+ elif tres == 'socket':
+ errcode = F_SOCK
elif tres == 'error':
errcode = F_WARN
elif tres is not None:
@@ -2106,6 +2108,12 @@ def RunTest(env, TST, BusyPorts, COND, o
##rm -f .new.left-over.tmp.bats.
$TSTTRGBASE/Tests/.old.left-over.tmp.bats.
##if [ -f .all.left-over.tmp.bats. ] ; then mv -f
.all.left-over.tmp.bats. $TSTTRGBASE/Tests/.old.left-over.tmp.bats. ; fi
+ if tres == 'socket':
+ if quiet:
+ STDOUT.write("\n%s : Socket!\n" % TST)
+ elif verbose:
+ STDOUT.write("(Socket!) ")
+
if tres == 'timeout':
if quiet:
STDOUT.write("\n%s : Timeout!\n" % TST)
@@ -2344,7 +2352,9 @@ def RunTest(env, TST, BusyPorts, COND, o
FailedOut, FailedErr)
if not verbose and not quiet:
- if tres == 'timeout':
+ if tres == 'socket':
+ STDOUT.write("%sSOCKET%s" % (PURPLE, BLACK))
+ elif tres == 'timeout':
STDOUT.write("%sTIMEOUT%s" % (PURPLE, BLACK))
elif tres == 'recursion':
STDOUT.write("%sRECURSION%s" % (PURPLE, BLACK))
@@ -2965,22 +2975,20 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
return None
# Try to detect segfaults and the like
- TO = re.compile("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus
[Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))",
re.MULTILINE)
- # FIXME: this begs for a much nicer solution (100% copy of below)
- for f in (TestErrFile, TestOutFile):
- if os.path.isfile(f):
- for l in open(f):
- if TO.search(l):
- return 'segfault'
-
# Try to detect aborts due to too deep recursion
- TO = re.compile("aborted too deep recursion", re.MULTILINE)
- # FIXME: this begs for a much nicer solution (100% copy of above)
- for f in (TestErrFile, TestOutFile):
- if os.path.isfile(f):
- for l in open(f):
- if TO.search(l):
- return 'recursion'
+ for (regexp, msg) in [("(^(|[^#]*[\t ])((Memory|Segmentation) [Ff]ault|Bus
[Ee]rror|Aborted|Assertion (|.* )failed[:\.]|!FATAL: BATSIGabort:)([ \t]|$))",
+ 'segfault'),
+ ("aborted too deep recursion",
+ 'recursion'),
+ ("mal_mapi\.listen:operation failed: bind to stream
socket port",
+ 'socket')]:
+ TO = re.compile(regexp, re.MULTILINE)
+ # FIXME: this begs for a much nicer solution (100% copy of below)
+ for f in (TestErrFile, TestOutFile):
+ if os.path.isfile(f):
+ for l in open(f):
+ if TO.search(l):
+ return msg
return None
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list