Changeset: b4d475709877 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b4d475709877
Modified Files:
        gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

Fine tune: only attempt move if there is a possibility it might be needed.


diffs (58 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4109,34 +4109,41 @@ BBPsync(int cnt, bat *restrict subcommit
                        if (lock)
                                MT_lock_set(&GDKswapLock(bid));
                }
-               if (subcommit) {
+               BAT *b = BBP_desc(bid);
+               if (subcommit && b->ttype != TYPE_void) {
                        /* move any tail/theap files we find for this bat that
                         * are in the BACKUP directory to the SUBCOMMIT
                         * directory */
                        char fname[16]; /* plenty big enough */
-                       if (snprintf(fname, sizeof(fname), "%o", (unsigned) i) 
< 16) {
+                       if (snprintf(fname, sizeof(fname), "%o", (unsigned) 
bid) < 16) {
                                /* the snprintf never fails, any of the
                                 * below may fail */
-                               if (GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
-                                       TRC_DEBUG(BAT_, "moved %s.tail from %s 
to %s\n",
+                               uint8_t stpe = ATOMstorage(b->ttype);
+                               if ((b->ttype != TYPE_str || b->twidth >= 8) &&
+                                   GDKmove(0, BAKDIR, fname, "tail", SUBDIR, 
fname, "tail", false) == GDK_SUCCEED)
+                                       TRC_DEBUG(IO_, "moved %s.tail from %s 
to %s\n",
                                                  fname, BAKDIR, SUBDIR);
-                               if (GDKmove(0, BAKDIR, fname, "tail1", SUBDIR, 
fname, "tail1", false) == GDK_SUCCEED)
-                                       TRC_DEBUG(BAT_, "moved %s.tail1 from %s 
to %s\n",
+                               if (stpe == TYPE_str &&
+                                   GDKmove(0, BAKDIR, fname, "tail1", SUBDIR, 
fname, "tail1", false) == GDK_SUCCEED)
+                                       TRC_DEBUG(IO_, "moved %s.tail1 from %s 
to %s\n",
                                                  fname, BAKDIR, SUBDIR);
-                               if (GDKmove(0, BAKDIR, fname, "tail2", SUBDIR, 
fname, "tail2", false) == GDK_SUCCEED)
-                                       TRC_DEBUG(BAT_, "moved %s.tail2 from %s 
to %s\n",
+                               if (stpe == TYPE_str && b->twidth >= 2 &&
+                                   GDKmove(0, BAKDIR, fname, "tail2", SUBDIR, 
fname, "tail2", false) == GDK_SUCCEED)
+                                       TRC_DEBUG(IO_, "moved %s.tail2 from %s 
to %s\n",
                                                  fname, BAKDIR, SUBDIR);
 #if SIZEOF_VAR_T == 8
-                               if (GDKmove(0, BAKDIR, fname, "tail4", SUBDIR, 
fname, "tail4", false) == GDK_SUCCEED)
-                                       TRC_DEBUG(BAT_, "moved %s.tail4 from %s 
to %s\n",
+                               if (stpe == TYPE_str && b->twidth >= 4 &&
+                                   GDKmove(0, BAKDIR, fname, "tail4", SUBDIR, 
fname, "tail4", false) == GDK_SUCCEED)
+                                       TRC_DEBUG(IO_, "moved %s.tail4 from %s 
to %s\n",
                                                  fname, BAKDIR, SUBDIR);
 #endif
-                               if (GDKmove(0, BAKDIR, fname, "theap", SUBDIR, 
fname, "theap", false) == GDK_SUCCEED)
-                                       TRC_DEBUG(BAT_, "moved %s.theap from %s 
to %s\n",
+                               if (ATOMvarsized(b->ttype) &&
+                                   GDKmove(0, BAKDIR, fname, "theap", SUBDIR, 
fname, "theap", false) == GDK_SUCCEED)
+                                       TRC_DEBUG(IO_, "moved %s.theap from %s 
to %s\n",
                                                  fname, BAKDIR, SUBDIR);
                        }
                }
-               BAT *b = dirty_bat(&i, subcommit != NULL);
+               b = dirty_bat(&i, subcommit != NULL);
                if (i <= 0 ||
                    (BBP_status(bid) & BBPEXISTING &&
                     b != NULL &&
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to