Changeset: 7ef15bf9feb9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7ef15bf9feb9
Modified Files:
        sql/storage/bat/bat_logger.c
Branch: default
Log Message:

Relax over-eager consistency check


diffs (28 lines):

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
@@ -1114,18 +1114,23 @@ snapshot_wal(stream *plan, const char *d
                fclose(f);
                return GDK_FAIL;
        }
-       assert(version == 52204); // if version has changed this code may need 
to be revised
        ret = fscanf(f, LLSCN, &start_id); // real read (log id))
        if (ret != 1) {
                GDKerror("Could not read log id from %s", meta_file);
                fclose(f);
                return GDK_FAIL;
        }
+       // if there's more the file format must have changed
+       // and this code should be updated accordingly:
+       assert((fscanf(f, " "), feof(f))); // sanity check
        fclose(f);
 
        // Determining the current log file is easy
        cur_id = bat_logger->id;
 
+       assert(start_id >= 1);
+       assert(start_id <= cur_id);
+
        for (lng i = start_id; i <= cur_id; i++) {
                len = snprintf(log_file, sizeof(log_file),
                               "%s/%s%s." LLFMT, db_dir, bat_logger->dir, 
LOGFILE, i);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to