hybriel
Opening an hl:mpackdb table rewrites its files
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
architect opened the ticket 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.
Anton commented Confirmed. Opened an existing @id table with
compact = falseand 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.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:
- Build branch ticket-lang; copy a store, note
stat -c '%n %Y' *of its files. - 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 = falseis the read-only mode.
- Build branch ticket-lang; copy a store, note
Anton changed the state progress 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.