Skip to content

B4: Staging, scratch and free space #138

Backlog

Description

@Claptar

Part of #149.

wave 1 · 0.17.11 · size M

Goal. Every write is preceded by a free-space check that covers its scratch, an empty plan is a refusal, and staging's rollback and lock takeover hold in their corner cases.

Owns: util/staging.py, core/recast.py, commands/split.py, core/subset.py (the free-space estimate only), core/concat.py and core/csr_build.py (scratch naming only)

Approach:

  • The swap rolls back by renaming, which is atomic, and re-raises the original error.
  • Lock takeover through a lock of the lock (O_EXCL), or a fresh link compared by inode.
  • Scratch is named after the output, so the leftover check finds and names it after a SIGKILL.
  • recast's dense-to-CSC path checks space for its scratch before writing it.
  • A var-only subset's estimate scales each element by the axes it is aligned to.
  • split refuses before creating its folder when --min-size skips every group.
  • Coverage of staging.py's rollback branches (92% now).

Findings

Ref Sev Finding Where
F187 M split with every group under --min-size exits 0 with no stores and an empty manifest commands/split.py:113
F188 M recast dense->CSC writes its scratch CSR before any free-space check covers it core/recast.py:760
F189 M var-only subset's free-space estimate scales obs/obsm/obsp by the var share core/subset.py:1457
F190 M Swap rollback: if removing a swapped output fails, old copy stays aside and error is masked util/staging.py:475
F191 L Killed concat/transpose leaves hidden scratch that the rerun's leftover check never names core/concat.py:984
F192 L Lock takeover race lets two runs hold one output's lock util/staging.py:217

Done when one PR on fix/b4 closes this, with a regression test against an oracle for every finding, and docs and changelog in the same PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions