Commit b27fc03d authored by Nils Goroll's avatar Nils Goroll

mark where we might want to handle ENOSPC

... which would require error handling on all of the call stack upwards,
which is not that trivial an endavour. Also, for the calls via
VSMW_DestroyCluster(), we are actually about to free space, but
temporarily need more.

Other ideas:

- panic, but leave a better error message
- monitor free space and refuse loading vcls if insufficient
- maybe as part of some more general vcl management (e.g.
  "maintain max xx vcls loaded - aka auto-discard)

Ref #2764
parent c1cde2d3
......@@ -122,6 +122,7 @@ vsmw_idx_head(const struct vsmw *vsmw, int fd)
char buf[64];
bprintf(buf, "# %jd %jd\n", (intmax_t)vsmw->pid, (intmax_t)vsmw->birth);
// XXX handle ENOSPC? #2764
assert(write(fd, buf, strlen(buf)) == strlen(buf));
}
......@@ -177,6 +178,7 @@ vsmw_addseg(struct vsmw *vsmw, struct vsmwseg *seg)
vsmw_fmt_index(vsmw, seg);
AZ(VSB_finish(vsmw->vsb));
s = write(fd, VSB_data(vsmw->vsb), VSB_len(vsmw->vsb));
// XXX handle ENOSPC? #2764
assert(s == VSB_len(vsmw->vsb));
closefd(&fd);
}
......@@ -211,6 +213,7 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg, int fixidx)
vsmw_fmt_index(vsmw, seg);
AZ(VSB_finish(vsmw->vsb));
s = write(fd, VSB_data(vsmw->vsb), VSB_len(vsmw->vsb));
// XXX handle ENOSPC? #2764
assert(s == VSB_len(vsmw->vsb));
closefd(&fd);
AZ(renameat(vsmw->vdirfd, t, vsmw->vdirfd, vsmw->idx));
......
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