Changeset: 5ea6939edb61 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5ea6939edb61
Modified Files:
gdk/gdk_bbp.c
Branch: Jun2016
Log Message:
Fix for bug 4036.
GDKupgradevarheap creates a backup for persistent BATs in the BACKUP
directory. If the BAT is then made transient in the same transaction,
the subcommit that does the work ignored the BACKUP file for the BAT,
so it remained, causing havoc later when the BAT ID was reused. Now,
subcommit will move the file to the SUBCOMMIT directory which gets
renamed and then deleted when the transaction commits.
diffs (22 lines):
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3797,6 +3797,18 @@ BBPsync(int cnt, bat *subcommit)
if (BBP_status(i) & BBPEXISTING) {
if (b != NULL && BBPbackup(b, subcommit !=
NULL) != GDK_SUCCEED)
break;
+ } else if (subcommit && (b = &BBP_desc(i)->B) &&
BBP_status(i) & BBPDELETED) {
+ char o[10];
+ char *f;
+ snprintf(o, sizeof(o), "%o", b->batCacheid);
+ f = GDKfilepath(b->T->heap.farmid, BAKDIR, o,
"tail");
+ if (access(f, F_OK) == 0)
+ file_move(b->T->heap.farmid, BAKDIR,
SUBDIR, o, "tail");
+ GDKfree(f);
+ f = GDKfilepath(b->T->heap.farmid, BAKDIR, o,
"theap");
+ if (access(f, F_OK) == 0)
+ file_move(b->T->heap.farmid, BAKDIR,
SUBDIR, o, "theap");
+ GDKfree(f);
}
}
if (idx < cnt)
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list