Changeset: 1ba785a6ce6c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1ba785a6ce6c
Modified Files:
        sql/storage/bat/bat_storage.c
Branch: Apr2019
Log Message:

removed swap of dbat bats (fixes crash of concurrent access (read and write))


diffs (64 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
@@ -2667,47 +2667,6 @@ tr_update_dbat(sql_trans *tr, sql_dbat *
        return ok;
 }
 
-/* the central and transaction local bats need to be swapped */
-static int
-tr_update_dbat_swap(sql_dbat *tdb, sql_dbat *fdb)
-{
-       /* The fdb holds the central bat, tdb has the proper new rows
-        * Add these (new) rows to the fdb->dbid
-        * and remove the rows from tdb->dbid.
-        * Swap both tdb->dbid/fdb->dbid */
-       int ok = LOG_OK;
-       BAT *db = NULL;
-       BUN cnt;
-
-       if (!fdb)
-               return ok;
-
-       db = temp_descriptor(tdb->dbid);
-       if(!db)
-               return LOG_ERR;
-       if (BUNlast(db) > db->batInserted) {
-               BAT *odb = temp_descriptor(fdb->dbid);
-               if(odb) {
-                       cnt = BATcount(odb);
-                       if (append_inserted(odb, db) == BUN_NONE)
-                               ok = LOG_ERR;
-                       else {
-                               BATcommit(odb);
-                               BATsetcount(db, cnt);
-                       }
-                       bat_destroy(odb);
-               } else {
-                       ok = LOG_ERR;
-               }
-       }
-       if (ok == LOG_OK) {
-               tdb->dbid = fdb->dbid; 
-               fdb->dbid = db->batCacheid;
-       }
-       bat_destroy(db);
-       return ok;
-}
-
 static int
 tr_merge_dbat(sql_trans *tr, sql_dbat *tdb)
 {
@@ -2769,12 +2728,6 @@ update_table(sql_trans *tr, sql_table *f
                                destroy_dbat(tr, b->next);
                                b->next = NULL;
                        }
-                       if (ATOMIC_GET(&store_nr_active) > 1 && tr->parent == 
gtrans) {
-                               b = tt->data;
-                               /* The central (as known to the logger) and 
-                                * transaction local bats need to be swapped */
-                               tr_update_dbat_swap(tt->data, b->next);
-                       }
                } else if (tt->data && ft->base.allocated) {
                        tr_update_dbat(tr, tt->data, ft->data, ft->cleared);
                } else if (ATOMIC_GET(&store_nr_active) == 1 && 
!ft->base.allocated) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to