Changeset: 69bc3bc0192f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/69bc3bc0192f
Modified Files:
        gdk/gdk_logger.c
        sql/storage/store.c
Branch: default
Log Message:

Special case for new database: rotate and flush log after initialization.


diffs (26 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2888,8 +2888,9 @@ log_activate(logger *lg)
            !lg->current->next &&
            current_file_size > 2 &&
            (ATOMIC_GET(&lg->current->drops) > (ulng)lg->max_dropped ||
-                   current_file_size > lg->max_file_size ||
-                   (GDKusec() - lg->file_age) > lg->max_file_age) &&
+            current_file_size > lg->max_file_size ||
+            (GDKusec() - lg->file_age) > lg->max_file_age ||
+            lg->saved_id == 0 /* first time only */) &&
            (ulng) ATOMIC_GET(&lg->current->last_ts) > 0 &&
            lg->saved_id + 1 == lg->id &&
            ATOMIC_GET(&lg->current->refcount) == 1 /* no pending work on this 
file */ ) {
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2464,6 +2464,7 @@ store_manager(sqlstore *store)
 
        // In the main loop we always hold the lock except when sleeping or 
doing cleanups
        MT_lock_set(&store->flush);
+       store->debug |= 1024;           /* first time, activate log */
 
        for (;;) {
                const int idle = ATOMIC_GET(&GDKdebug) & TESTINGMASK ? 5000 : 
IDLE_TIME * 1000000;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to