Changeset: c48f3d26fe2a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c48f3d26fe2a Modified Files: gdk/gdk.h Branch: default Log Message:
Merge with Oct2020 branch. diffs (107 lines): diff --git a/.editorconfig b/.editorconfig --- a/.editorconfig +++ b/.editorconfig @@ -5,7 +5,7 @@ root = true end_of_line = lf insert_final_newline = true -[*.{c,h}] +[*.{c,h}{,.in}] indent_style = tab tab_width = 4 indent_size = tab @@ -13,8 +13,13 @@ trim_trailing_whitespace = true charset = utf-8 max_line_length = 120 -[*.py] +[*.py{,.in}] indent_style = space indent_size = 4 trim_trailing_whitespace = true charset = utf-8 + +[{CMakeLists.txt,*.cmake}{,.in}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -1334,17 +1334,18 @@ gdk_export bat BBPlimit; gdk_export BBPrec *BBP[N_BBPINIT]; /* fast defines without checks; internal use only */ -#define BBP_cache(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].cache -#define BBP_logical(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].logical -#define BBP_bak(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].bak -#define BBP_next(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].next -#define BBP_physical(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].physical -#define BBP_options(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].options -#define BBP_desc(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].desc -#define BBP_refs(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].refs -#define BBP_lrefs(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].lrefs -#define BBP_status(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].status -#define BBP_pid(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)].pid +#define BBP_record(i) BBP[(i)>>BBPINITLOG][(i)&(BBPINIT-1)] +#define BBP_cache(i) BBP_record(i).cache +#define BBP_logical(i) BBP_record(i).logical +#define BBP_bak(i) BBP_record(i).bak +#define BBP_next(i) BBP_record(i).next +#define BBP_physical(i) BBP_record(i).physical +#define BBP_options(i) BBP_record(i).options +#define BBP_desc(i) BBP_record(i).desc +#define BBP_refs(i) BBP_record(i).refs +#define BBP_lrefs(i) BBP_record(i).lrefs +#define BBP_status(i) BBP_record(i).status +#define BBP_pid(i) BBP_record(i).pid #define BATgetId(b) BBP_logical((b)->batCacheid) #define BBPvalid(i) (BBP_logical(i) != NULL && *BBP_logical(i) != '.') diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -2199,10 +2199,13 @@ flusher_should_run(void) char *reason_to = NULL, *reason_not_to = NULL; int changes; + if (logger_funcs.changes() >= 1000000) + ATOMIC_SET(&flusher.flush_now, 1); + if (flusher.countdown_ms <= 0) reason_to = "timer expired"; - int many_changes = GDKdebug & FORCEMITOMASK ? 100 : 1000000; + int many_changes = GDKdebug & FORCEMITOMASK ? 100 : 100000; if ((changes = logger_funcs.changes()) >= many_changes) reason_to = "many changes"; else if (changes == 0) @@ -2330,7 +2333,8 @@ store_apply_deltas(bool not_locked) void store_flush_log(void) { - ATOMIC_SET(&flusher.flush_now, 1); + if (logger_funcs.changes() >= 1000000) + ATOMIC_SET(&flusher.flush_now, 1); } /* Call while holding bs_lock */ @@ -7603,9 +7607,18 @@ sql_session_reset(sql_session *s, int ac int sql_trans_begin(sql_session *s) { + const int sleeptime = GDKdebug & FORCEMITOMASK ? 10 : 50; + sql_trans *tr = s->tr; int snr = tr->schema_number; + /* add wait when flush is realy needed */ + while (ATOMIC_GET(&flusher.flush_now)) { + MT_lock_unset(&bs_lock); + MT_sleep_ms(sleeptime); + MT_lock_set(&bs_lock); + } + TRC_DEBUG(SQL_STORE, "Enter sql_trans_begin for transaction: %d\n", snr); if (tr->parent && tr->parent == gtrans && (tr->stime < gtrans->wstime || tr->wtime || _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list