Changeset: 52429466084f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/52429466084f
Modified Files:
        sql/ChangeLog.Jul2021
        sql/storage/store.c
Branch: Jul2021
Log Message:

Release the store lock while dumping bat contents into hot snapshot.
Taking a snapshot consists of two phases, gathering inforation, and
dumping.  During the second phase, we don't need to store lock as long
as we keep the flush lock and the GDKtmLock which prevent files from
being moved around.


diffs (33 lines):

diff --git a/sql/ChangeLog.Jul2021 b/sql/ChangeLog.Jul2021
--- a/sql/ChangeLog.Jul2021
+++ b/sql/ChangeLog.Jul2021
@@ -1,3 +1,7 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
+* Wed Apr  5 2023 Sjoerd Mullender <[email protected]>
+- When creating a hot snapshot, allow other clients to proceed, even
+  with updating queries.
+
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -2689,6 +2689,8 @@ store_hot_snapshot_to_stream(sqlstore *s
                goto end; // should already have set a GDK error
        close_stream(plan_stream);
        plan_stream = NULL;
+       MT_lock_unset(&store->lock);
+       locked = 2;
        r = hot_snapshot_write_tar(tar_stream, GDKgetenv("gdk_dbname"), 
buffer_get_buf(plan_buf));
        if (r != GDK_SUCCEED)
                goto end;
@@ -2705,7 +2707,8 @@ store_hot_snapshot_to_stream(sqlstore *s
 end:
        if (locked) {
                BBPtmunlock();
-               MT_lock_unset(&store->lock);
+               if (locked == 1)
+                       MT_lock_unset(&store->lock);
                MT_lock_unset(&store->flush);
        }
        if (plan_stream)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to