Changeset: d19034a2d873 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d19034a2d873
Modified Files:
        gdk/gdk_logger.c
Branch: Jun2023
Log Message:

small fix in log_activate (don't activate on flushnow)


diffs (50 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2202,7 +2202,8 @@ log_new(int debug, const char *fn, const
 }
 
 static logged_range*
-do_flush_range_cleanup(logger* lg) {
+do_flush_range_cleanup(logger* lg)
+{
        rotation_lock(lg);
        logged_range* frange = lg->flush_ranges;
        logged_range* first = frange;
@@ -2230,7 +2231,6 @@ do_flush_range_cleanup(logger* lg) {
                        frange->output_log = NULL;
                }
        }
-
        return flast;
 }
 
@@ -2373,7 +2373,7 @@ log_activate(logger *lg)
        bool flush = false;
        gdk_return res = GDK_SUCCEED;
        rotation_lock(lg);
-       if (!lg->current->next && lg->current->drops > 100000 && ((ulng) 
ATOMIC_GET(&lg->current->end) - (ulng) ATOMIC_GET(&lg->current->pend)) > 0 && 
lg->saved_id+1 == lg->id) {
+       if (!lg->flushnow && !lg->current->next && lg->current->drops > 100000 
&& ((ulng) ATOMIC_GET(&lg->current->end) - (ulng) 
ATOMIC_GET(&lg->current->pend)) > 0 && lg->saved_id+1 == lg->id) {
                lg->id++;
                /* start new file */
                res = log_open_output(lg);
@@ -2410,8 +2410,7 @@ log_flush(logger *lg, ulng ts)
                return GDK_SUCCEED;
        log_return res = LOG_OK;
        ulng cid = olid;
-       if (lid > lgid)
-               lid = lgid;
+       assert (lid <= lgid);
        while(cid < lid && res == LOG_OK) {
                if (!lg->input_log) {
                        char *filename;
@@ -3190,8 +3189,7 @@ log_tstart(logger *lg, bool flushnow, ul
                if (lg->saved_id+1 < lg->id)
                        log_flush(lg, (1ULL<<63));
                lg->flushnow = flushnow;
-       }
-       else {
+       } else {
                if (check_rotation_conditions(lg)) {
                        lg->id++;
                        if (log_open_output(lg) != GDK_SUCCEED)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to