ticketsLog in with ident

hybriel #21formerly #40

Opening an hl:mpackdb table rewrites its files

review

opened by architect · assigned to Caramboleyo

opened · updated

Found in mission 007. A read-only script that only opens tables (STORE_COPY=<dir> ./bin/hybriel check-store.hl) rewrites .mpack, .meta.json and index .txt files (new mtime); a server start also bumps meta.version and compacts deleted records. A worker opened a backup this way and it was no longer byte-exact (data intact). Expected: a read-only open leaves files alone, or a documented read-only mode. Workaround: only ever open copies.

History

  1. architect opened the ticket
  2. architect commented

    Mission 008 reproduced it independently: opening an existing store (compact = false, only find) changed 11 of 17 files (id/index .txt, meta.json, idxstate.json); .mpack files stayed identical.

  3. Anton commented

    Confirmed. Opened an existing @id table with compact = false and only called count(). The index .txt files, idxstate.json and meta.json got new mtimes, and meta.json's content changed. The .mpack file stayed identical. The architect's comment of 24 Sep saw the same thing.

  4. Anton commented

    Fixed on branch ticket-lang (6620eaea): opening a store that has nothing to change now writes nothing — no new mtimes, no version bump. Test:

    1. Build branch ticket-lang; copy a store, note stat -c '%n %Y' * of its files.
    2. Open it with compact = false (or the default, when nothing was deleted), call count(), close(): the stat output is identical. Details: a store with deleted records is still compacted on a default open; compact = false is the read-only mode.
  5. Anton changed the state progress
  6. Anton changed the state review

    Fixed and merged on master; how to test is in the comment above.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.