Changeset: d8f34fef9797 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d8f34fef9797
Modified Files:
        gdk/gdk_logger.c
        sql/storage/bat/bat_storage.c
        sql/storage/store.c
Branch: unlock
Log Message:

make sure too start flushing once we have log files


diffs (53 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -1855,7 +1855,7 @@ logger_flush(logger *lg)
 lng
 logger_changes(logger *lg)
 {
-       return (lg->saved_id - lg->id);
+       return (lg->id - lg->saved_id);
 }
 
 int
diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -1006,6 +1006,7 @@ log_create_delta(sql_delta *bat, sqlid i
        if (GDKinmemory())
                return res;
 
+       bat_set_access(b, BAT_READ);
        ok = log_bat_persists(bat_logger, b, id);
        bat_destroy(b);
        if(res != LOG_OK)
@@ -1227,6 +1228,7 @@ log_create_storage( storage *bat, sqlid 
        if (b == NULL)
                return LOG_ERR;
 
+       bat_set_access(b, BAT_READ);
        ok = log_bat_persists(bat_logger, b, id);
        bat_destroy(b);
        return ok == GDK_SUCCEED ? LOG_OK : LOG_ERR;
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2092,15 +2092,13 @@ flusher_should_run(void)
 {
        // We will flush if we have a reason to and no reason not to.
        char *reason_to = NULL, *reason_not_to = NULL;
-       int changes;
 
        if (flusher.countdown_ms <= 0)
                reason_to = "timer expired";
 
-       int many_changes = GDKdebug & FORCEMITOMASK ? 100 : 1000000;
-       if ((changes = logger_funcs.changes()) >= many_changes)
-               reason_to = "many changes";
-       else if (changes == 0)
+       if (logger_funcs.changes() >= 0)
+               reason_to = "changes";
+       else
                reason_not_to = "no changes";
 
        // Read and clear flush_now. If we decide not to flush
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to