Changeset: e316a0bce658 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e316a0bce658
Modified Files:
        sql/storage/bat/bat_storage.c
        sql/storage/store.c
Branch: Jan2022
Log Message:

Recover and improve the first optimizing check in merge_segments.


diffs (26 lines):

diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c
--- a/sql/storage/bat/bat_storage.c
+++ b/sql/storage/bat/bat_storage.c
@@ -409,7 +409,10 @@ merge_segments(storage *s, sql_trans *tr
                                int merge = 1;
                                node *n = store->active->h;
                                for (int i = 0; i < store->active->cnt; i++, n 
= n->next) {
-                                       ulng active = ((sql_trans*)n->data)->ts;
+                                       sql_trans* other = 
((sql_trans*)n->data);
+                                       ulng active = other->ts;
+                                       if(other->active == 2)
+                                               continue; /* pretent that an 
other recently committed transaction is no longer active */
                                        if (active == tr->ts)
                                                continue; /* pretent that 
committing transaction has already committed and is no longer active */
                                        if (seg->ts < active && cur->ts < 
active)
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4018,6 +4018,7 @@ sql_trans_commit(sql_trans *tr)
                        }
                        n = next;
                }
+               tr->active = 2; /* small hack enabling to signal that this 
transaction has committed */
                store_unlock(store);
                MT_lock_unset(&store->commit);
                list_destroy(tr->changes);
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to