Commit 925a949e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Properly count vsm segments and rebuild _.index when retired

segments dominate the _.index file.
parent 99d13d21
......@@ -204,7 +204,6 @@ vsmw_append_record(struct vsmw *vsmw, struct vsmwseg *seg, char act)
AZ(VSB_finish(vsmw->vsb));
XXXAZ(VSB_tofile(fd, vsmw->vsb)); // XXX handle ENOSPC? #2764
closefd(&fd);
vsmw->nsegs++;
}
/*--------------------------------------------------------------------*/
......@@ -235,7 +234,7 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg, int fixidx)
VTAILQ_REMOVE(&vsmw->segs, seg, list);
vsmw->nsegs--;
if (vsmw->nsubs < vsmw->nsegs || !fixidx) {
if (vsmw->nsubs * 2 < vsmw->nsegs || !fixidx) {
vsmw_append_record(vsmw, seg, '-');
vsmw->nsubs++;
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment