Changeset: d51e6b8d0de1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d51e6b8d0de1
Modified Files:
sql/storage/store.c
Branch: Jun2020
Log Message:
make sure we cleanup partitions, this is abit hard as we keep them
both in the schema's changeset and merge/replica members list.
To avoid double cleanup we need to properly zap the member.
Also in the rollforward of the schema changes we cleanup the moved (dropped)
parts directly
diffs (35 lines):
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -1171,10 +1171,10 @@ static void
part_destroy(sql_part *p)
{
node *n;
- if (p->t && p->t->members && (n=list_find(p->t->members, p, (fcmp)
NULL)) != NULL) {
+ if (p->t && p->t->members && (n=list_find(p->t->members, p, (fcmp)
NULL)) != NULL)
list_remove_node(p->t->members, n);
+ if (p && p->member)
p->member->partition--;
- }
}
static sql_schema *
@@ -4513,6 +4513,10 @@ rollforward_update_schema(sql_trans *tr,
ok = rollforward_changeset_updates(tr, &fs->seqs, &ts->seqs,
&ts->base, (rfufunc) &rollforward_update_seq, (rfcfunc)
&rollforward_create_seq, (rfdfunc) &rollforward_drop_seq, (dupfunc) &seq_dup,
mode);
if (ok == LOG_OK)
ok = rollforward_changeset_updates(tr, &fs->parts, &ts->parts,
&ts->base, (rfufunc) &rollforward_update_part, (rfcfunc)
&rollforward_create_part, (rfdfunc) &rollforward_drop_part, (dupfunc)
&part_dup, mode);
+ if (apply && ok == LOG_OK && ts->parts.dset) {
+ list_destroy(ts->parts.dset);
+ ts->parts.dset = NULL;
+ }
if (apply && ok == LOG_OK && strcmp(ts->base.name, fs->base.name) != 0)
{ /* apply possible renaming */
list_hash_delete(tr->schemas.set, ts, NULL);
@@ -6235,6 +6239,7 @@ sql_trans_del_table(sql_trans *tr, sql_t
cs_del(&mt->s->parts, n, p->base.flags);
list_remove_data(mt->members, p);
pt->partition--;/* check other hierarchies? */
+ p->member = NULL;
table_funcs.table_delete(tr, sysobj, obj_oid);
mt->s->base.wtime = mt->base.wtime = pt->s->base.wtime = pt->base.wtime
= p->base.wtime = tr->wtime = tr->wstime;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list