v_queue 0.2.9

simple file based queue
Documentation
# Changelog

All notable changes to the `v_queue` crate are recorded in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.9] - 2026-05-06

### Added

- New tests in `src/test.rs` covering the queue reliability fixes plan
  (`queue-reliability-tests`):
  - `test_push_rollback_on_write_error` — verifies that a `push` whose
    underlying write fails (simulated via `/dev/full`) returns `Err`, leaves
    `right_edge` and `count_pushed` at the last successfully persisted values,
    does not change the on-disk queue file, and that the queue stays usable
    after the failure (related to phase 1.2 of the reliability fixes plan).
  - `test_queue_new_fails_on_corrupted_info_push_crc` — corrupts the CRC
    digit of `<queue>_info_push` and expects `Queue::new(Read)` to return
    `Err(InvalidChecksum)` (phase 1.3).
  - `test_queue_new_fails_on_corrupted_info_queue_crc` — same idea for the
    per-queue `<queue>_info_queue` file (phase 1.3).
  - `test_double_open_returns_already_open` — opens a queue in `ReadWrite`
    mode, expects a second concurrent `ReadWrite` open to fail with
    `AlreadyOpen` while the first is alive, allows a parallel `Read` open,
    and re-checks that `ReadWrite` becomes available again after `drop`
    (phase 1.1).
  - `test_consumer_reconnect_arbitrary_queue_name` — uses a queue whose name
    is not the hardcoded `individuals-flow` and verifies that after
    `commit + drop + reconnect` the consumer resumes from its last committed
    position instead of restarting from zero (phase 2.1).

### Fixed

- Queue and consumer advisory locks are now held for the full lifetime of
  `Queue` and `Consumer`, so concurrent `ReadWrite` opens fail with
  `AlreadyOpen` instead of racing on the same files.
- `Queue::push` now uses full writes and rolls the queue file back to the last
  known good boundary if writing the record or updating push metadata fails.
- Queue metadata files are validated on read: CRC mismatches in
  `<queue>_info_queue` and `<queue>_info_push` now fail instead of silently
  producing stale or incorrect queue state.
- Consumer body reads now update `pos_record` and `count_popped` only after CRC
  verification succeeds, and tail-read failures rewind to the start of the
  record for retry.
- Consumer state files now use the actual queue name instead of the hardcoded
  `individuals-flow` prefix, so reconnect resumes from the committed position
  for arbitrary queue names.
- Info files are truncated before being rewritten, preventing stale bytes from
  previous longer records from being parsed by future readers.
- Header validation now checks the magic marker and message bounds before the
  body is allocated or read, and corrupted-record recovery requires a full
  4-byte marker match.
- Consumers now refresh the current part metadata when checking batch size, so
  newly appended messages become visible without waiting for the writer to roll
  to a new part.
- Writer restart reuses an empty current part instead of creating another empty
  queue part.

### Changed

- Reliability tests from `0.2.9` that were previously documented as ignored are
  now active and passing.

## [0.2.8]

- Baseline before the reliability tests were added (no changelog entry kept
  for previous releases).