Changeset: 116eade0db71 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/116eade0db71
Modified Files:
        gdk/gdk_logger.c
Branch: multi-cachelock
Log Message:

Revert to Sep2022 7th December revision 5d8955c8b023


diffs (45 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2789,9 +2789,12 @@ new_logfile(logger *lg)
        const lng log_large = (GDKdebug & FORCEMITOMASK)?LOG_MINI:LOG_LARGE;
 
        gdk_return result = GDK_SUCCEED;
+       MT_lock_set(&lg->rotation_lock);
        const lng p = (lng) getfilepos(getFile(lg->output_log));
-       if (p == -1)
+       if (p == -1) {
+               MT_lock_unset(&lg->rotation_lock);
                return GDK_FAIL;
+       }
        if (( p > log_large || (lg->end*1024) > log_large )) {
                log_lock(lg);
                if (ATOMIC_GET(&lg->refcount) == 1) {
@@ -2806,6 +2809,7 @@ new_logfile(logger *lg)
                }
                log_unlock(lg);
        }
+       MT_lock_unset(&lg->rotation_lock);
        return result;
 }
 
@@ -2912,19 +2916,16 @@ log_tflush(logger* lg, ulng log_file_id,
                        /* number of transactions in the group commit */
                        const int fqueue_length = flush_queue_length(lg);
                        /* flush + fsync */
-                       MT_lock_set(&lg->rotation_lock);
                        if (mnstr_flush(lg->output_log, MNSTR_FLUSH_DATA) ||
                                        (!(GDKdebug & NOSYNCMASK) && 
mnstr_fsync(lg->output_log)) ||
                                        new_logfile(lg) != GDK_SUCCEED) {
                                /* flush failed */
-                               MT_lock_unset(&lg->rotation_lock);
                                MT_lock_unset(&lg->flush_lock);
                                (void) ATOMIC_DEC(&lg->refcount);
                                return GDK_FAIL;
                        }
                        else {
                                /* flush succeeded */
-                               MT_lock_unset(&lg->rotation_lock);
                                left_truncate_flush_queue(lg, fqueue_length);
                        }
                }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to