Changeset: 54843a0beb6b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/54843a0beb6b
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Dec2023
Log Message:

Use heaplock all the way.
This may well fix a bug where deleted-rows bats show wrong
information while being updated.


diffs (29 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
@@ -336,11 +336,8 @@ segments2cs(sql_trans *tr, segments *seg
        b->tnokey[1] = 0;
        b->theap->dirty = true;
        BUN cnt = BATcount(b);
-       MT_lock_unset(&b->theaplock);
 
        uint32_t *restrict dst;
-       /* why hashlock ?? */
-       MT_rwlock_wrlock(&b->thashlock);
        for (; s ; s=ATOMIC_PTR_GET(&s->next)) {
                if (s->start >= nr)
                        break;
@@ -407,12 +404,10 @@ segments2cs(sql_trans *tr, segments *seg
                                cnt = s->end;
                }
        }
-       MT_rwlock_wrunlock(&b->thashlock);
        if (nr > BATcount(b)) {
-               MT_lock_set(&b->theaplock);
                BATsetcount(b, nr);
-               MT_lock_unset(&b->theaplock);
        }
+       MT_lock_unset(&b->theaplock);
 
        bat_destroy(b);
        return LOG_OK;
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to