Changeset: 049f0782c886 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/049f0782c886 Modified Files: gdk/gdk_bbp.c monetdb5/modules/mal/tablet.c sql/storage/bat/bat_storage.c Branch: default Log Message:
Merge with Dec2023 branch. diffs (163 lines): diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -48,7 +48,12 @@ jobs: ref: ${{ github.ref }} - name: install pymonetdb cryptography - run: pip3 install pymonetdb cryptography + run: pip3 install --user --upgrade pymonetdb cryptography + if: runner.os != 'macOS' + + - name: install pymonetdb cryptography + run: pip3 install --user --break-system-packages --upgrade pymonetdb cryptography + if: runner.os == 'macOS' - name: make MonetDB on linux run: | @@ -83,7 +88,23 @@ jobs: -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison \ -DCMAKE_SUMMARY=ON make install -j3 - if: runner.os == 'macOS' + if: runner.os == 'macOS' && runner.arch == 'x64' + + - name: make MonetDB on macos + run: | + mkdir build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=$HOME/MDB \ + -DPY3INTEGRATION=OFF \ + -DRINTEGRATION=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DASSERT=OFF \ + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \ + -DBISON_EXECUTABLE=/opt/homebrew/opt/bison/bin/bison \ + -DCMAKE_SUMMARY=ON + make install -j3 + if: runner.os == 'macOS' && runner.arch == 'arm64' - name: choco packages run: | diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c --- a/gdk/gdk_bbp.c +++ b/gdk/gdk_bbp.c @@ -4065,6 +4065,33 @@ BBPsync(int cnt, bat *restrict subcommit if (lock) MT_lock_set(&GDKswapLock(bid)); } + if (subcommit) { + /* 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", i) < 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", + 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", + 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", + 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", + 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", + fname, BAKDIR, SUBDIR); + } + } BAT *b = dirty_bat(&i, subcommit != NULL); if (i <= 0) ret = GDK_FAIL; diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c --- a/monetdb5/modules/mal/tablet.c +++ b/monetdb5/modules/mal/tablet.c @@ -1945,8 +1945,7 @@ SQLload_file(Client cntxt, Tablet *as, b return BUN_NONE; } -/* return the latest reject table, to be on the safe side we should - * actually create copies within a critical section. Ignored for now. */ +/* return the latest reject table */ str COPYrejects(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) { @@ -1958,10 +1957,27 @@ COPYrejects(Client cntxt, MalBlkPtr mb, create_rejects_table(cntxt); if (cntxt->error_row == NULL) throw(MAL, "sql.rejects", "No reject table available"); - BBPretain(*row = cntxt->error_row->batCacheid); - BBPretain(*fld = cntxt->error_fld->batCacheid); - BBPretain(*msg = cntxt->error_msg->batCacheid); - BBPretain(*inp = cntxt->error_input->batCacheid); + MT_lock_set(&errorlock); + BAT *bn1 = COLcopy(cntxt->error_row, cntxt->error_row->ttype, true, TRANSIENT); + BAT *bn2 = COLcopy(cntxt->error_fld, cntxt->error_fld->ttype, true, TRANSIENT); + BAT *bn3 = COLcopy(cntxt->error_msg, cntxt->error_msg->ttype, true, TRANSIENT); + BAT *bn4 = COLcopy(cntxt->error_input, cntxt->error_input->ttype, true, TRANSIENT); + MT_lock_unset(&errorlock); + if (bn1 == NULL || bn2 == NULL || bn3 == NULL || bn4 == NULL) { + BBPreclaim(bn1); + BBPreclaim(bn2); + BBPreclaim(bn3); + BBPreclaim(bn4); + throw(MAL, "sql.rejects", GDK_EXCEPTION); + } + *row = bn1->batCacheid; + *fld = bn2->batCacheid; + *msg = bn3->batCacheid; + *inp = bn4->batCacheid; + BBPkeepref(bn1); + BBPkeepref(bn2); + BBPkeepref(bn3); + BBPkeepref(bn4); (void) mb; return MAL_SUCCEED; } 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 @@ -4472,7 +4472,7 @@ tc_gc_col( sql_store Store, sql_change * return LOG_OK; /* cannot cleanup yet */ // d is oldest reachable delta - if (d->next) // Unreachable can immediately be destroyed. + if (d->cs.merged && d->next) // Unreachable can immediately be destroyed. destroy_delta(d->next, true); d->next = NULL; @@ -4512,7 +4512,7 @@ tc_gc_upd_col( sql_store Store, sql_chan return LOG_OK; /* cannot cleanup yet */ // d is oldest reachable delta - if (d->next) // Unreachable can immediately be destroyed. + if (d->cs.merged && d->next) // Unreachable can immediately be destroyed. destroy_delta(d->next, true); d->next = NULL; @@ -4552,7 +4552,7 @@ tc_gc_idx( sql_store Store, sql_change * return LOG_OK; /* cannot cleanup yet */ // d is oldest reachable delta - if (d->next) // Unreachable can immediately be destroyed. + if (d->cs.merged && d->next) // Unreachable can immediately be destroyed. destroy_delta(d->next, true); d->next = NULL; @@ -4592,7 +4592,7 @@ tc_gc_upd_idx( sql_store Store, sql_chan return LOG_OK; /* cannot cleanup yet */ // d is oldest reachable delta - if (d->next) // Unreachable can immediately be destroyed. + if (d->cs.merged && d->next) // Unreachable can immediately be destroyed. destroy_delta(d->next, true); d->next = NULL; _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org