Changeset: 98ad79c555cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=98ad79c555cc
Modified Files:
gdk/gdk_logger.c
Branch: Dec2016
Log Message:
When reading the WAL, turn off property checking.
Think of this convoluted scenario: A BAT is created that is large
enough to be memory mapped. The BAT is saved on disk and in the
BBP.dir file. Then we call sys.vacuum on the table containing the
BAT. This is committed through the WAL, but not yet on disk.
However, since the BAT is memory mapped, the vacuumed data may well
end up on disk. Then exit the server.
During reading of the WAL, the logger first encounters the BAT with
the properties from before the call to vacuum, but possibly with the
data from after the vacuum. The WAL contains all the necessary
information to reconstruct the properties correctly, but they are not
yet in sync with the data. WE MUST NOT CHECK THOSE PROPERTIES!
diffs (37 lines):
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -896,6 +896,9 @@ logger_readlog(logger *lg, char *filenam
time_t t0, t1;
struct stat sb;
lng fpos;
+ int dbg = GDKdebug;
+
+ GDKdebug &= ~(CHECKMASK|PROPMASK);
if (lg->debug & 1) {
fprintf(stderr, "#logger_readlog opening %s\n", filename);
@@ -908,6 +911,7 @@ logger_readlog(logger *lg, char *filenam
if (lg->log)
mnstr_destroy(lg->log);
lg->log = NULL;
+ GDKdebug = dbg;
return LOG_ERR;
}
if (fstat(fileno(getFile(lg->log)), &sb) < 0) {
@@ -916,6 +920,7 @@ logger_readlog(logger *lg, char *filenam
lg->log = NULL;
/* If we can't read the files, it might simply be empty.
* In that case we can't return LOG_ERR, since it's actually
fine */
+ GDKdebug = dbg;
return 1;
}
t0 = time(NULL);
@@ -1025,6 +1030,7 @@ logger_readlog(logger *lg, char *filenam
printf("# Finished reading the write-ahead log '%s'\n",
filename);
fflush(stdout);
}
+ GDKdebug = dbg;
return LOG_OK;
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list