Changeset: 81851f049418 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/81851f049418 Modified Files: gdk/gdk_logger.c Branch: Jun2023 Log Message:
Add some rotation locks to protect manipulation of pending list. Hopefully this prevents the occasional crash in segments-corruption. diffs (51 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -2276,7 +2276,6 @@ do_flush_range_cleanup(logger *lg) logged_range *flast = frange; lg->flush_ranges = flast; - rotation_unlock(lg); for (frange = first; frange && frange != flast; frange = frange->next) { ATOMIC_DEC(&frange->refcount); @@ -2287,6 +2286,7 @@ do_flush_range_cleanup(logger *lg) ATOMIC_DEC(&lg->nr_open_files); } } + rotation_unlock(lg); return flast; } @@ -2407,6 +2407,7 @@ log_next_logfile(logger *lg, ulng ts) static void log_cleanup_range(logger *lg, ulng id) { + rotation_lock(lg); while (lg->pending && lg->pending->id <= id) { logged_range *p; p = lg->pending; @@ -2414,6 +2415,7 @@ log_cleanup_range(logger *lg, ulng id) lg->pending = p->next; GDKfree(p); } + rotation_unlock(lg); } static void @@ -3058,6 +3060,7 @@ gdk_return log_tflush(logger *lg, ulng file_id, ulng commit_ts) { if (lg->flushnow) { + rotation_lock(lg); assert(lg->flush_ranges == lg->current); assert(ATOMIC_GET(&lg->current->flushed_ts) == ATOMIC_GET(&lg->current->last_ts)); log_tdone(lg, lg->current, commit_ts); @@ -3067,6 +3070,7 @@ log_tflush(logger *lg, ulng file_id, uln if (log_open_output(lg) != GDK_SUCCEED) GDKfatal("Could not create new log file\n"); /* TODO: does not have to be fatal (yet) */ do_rotate(lg); + rotation_unlock(lg); (void) do_flush_range_cleanup(lg); assert(lg->flush_ranges == lg->current); return log_commit(lg, NULL, 0); _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org