Skip to content

Releases: RuiNelson/libpcache

1.1.5

Choose a tag to compare

@RuiNelson RuiNelson released this 08 Jul 10:23

Version 1.1.5

Bug Fixes

  • Fixed FIFO eviction order being corrupted by explicit deletes. Deleting a page from a FIFO volume could leave a stray empty slot that hijacked the implicit cursor, causing subsequent writes to evict the newest pages instead of the oldest — or to evict prematurely while capacity remained. Every delete operation on a FIFO volume now ends with a compaction pass that merges the holes into the cursor run while preserving the circular age order. Volumes left in an ambiguous state by a crash — or written by earlier library versions — are repaired automatically on pcache_open.

    Note for adopters: deletion on FIFO volumes is now a costly operation (up to O(live pages) of page copies per call). Batch deletions with pcache_delete_pages or pcache_delete_pages_range to amortize the cost. FIXED volumes are unaffected.

  • Fixed pcache_check_pages_range leaving *count_out untouched when failing with PCACHE_CHECK_RANGE_INVALID_RANGE; it is now set to zero on every error return, matching pcache_get_pages_range.

  • Fixed I/O errors from short reads/writes (e.g. a data file truncated by a crash) being reported with posix_error == 0 or a stale errno; short transfers now report EIO and real errors keep their errno.

  • Fixed a potential out-of-bounds write in the *_with_counter functions on platforms with a 32-bit size_t (e.g. arm64_32), where a huge position value could wrap past the bounds check.

  • Fixed pcache_open silently ignoring a failure of the row-count query, which could send later FIFO writes down the fill-up path and insert rows beyond max_pages; the open now fails instead.

1.1.4

Choose a tag to compare

@RuiNelson RuiNelson released this 14 Jun 18:52

Version 1.1.4

Bug Fixes

  • Hardened atomic batch page writes (pcache_put_pages and counter variant). If a data-file write or index commit fails after an existing slot is overwritten, the original bytes of every pre-existing live page are now restored before the function returns. When fail_if_exists is true, intra-batch duplicate identifiers are also rejected before any I/O begins.
  • Fixed a consistency bug in pcache_set_max_pages where an fsync/checkpoint failure after a successful metadata commit could leave the in-memory max_pages value out of sync with the persisted configuration. The in-memory value is now updated immediately after the metadata COMMIT.
  • Fixed pcache_get_pages_range to zero *count_out up front so the output is well-defined on every error return (INVALID_RANGE, BUFFER_TOO_SMALL), matching pcache_check_pages_range.
  • pcache_open now rejects volumes whose persisted page_size, max_pages, or id_size is zero with PCACHE_OPEN_CORRUPT.

1.1.3

Choose a tag to compare

@RuiNelson RuiNelson released this 06 Jun 21:12

Version 1.1.3

Bug Fixes

  • Fixed spurious I/O errors on durable deletes. After a successful page lookup, the internal find_rowid statement kept an open read cursor, leaving a lingering read transaction on WAL databases. That blocked a subsequent sqlite3_wal_checkpoint_v2(SQLITE_CHECKPOINT_RESTART) with SQLITE_LOCKED, surfacing as an I/O error to callers performing durable deletes.

1.1.2

Choose a tag to compare

@RuiNelson RuiNelson released this 02 May 23:22

Bug Fixes

  • pcache_set_max_pages updated the in-memory max_pages before confirming the durable sync; on I/O failure the caller received an error but pcache_inspect_configuration would already return the new value.
  • pcache_set_max_pages accepted new_max_pages = 0, silently writing an invalid capacity to both the in-memory configuration and the on-disk metadata. Passing zero now fails immediately with PCACHE_SET_MAX_PAGES_INVALID_ARGUMENT.
  • pcache_inspect_configuration was documented as returning the configuration frozen at open time; the documentation now reflects that pcache_set_max_pages can update it at runtime.

1.1.1

Choose a tag to compare

@RuiNelson RuiNelson released this 30 Apr 19:14

Bug Fixes

  • sqlite_error was incorrectly set on successful calls to pcache_check_pages_range and pcache_get_pages_range.
  • fsync failures reported a generic EIO instead of the actual error code.
  • Opening more than 16 volumes concurrently could cause crashes or silent data corruption in other threads.
  • pcache_inspect_configuration and pcache_inspect_page_count were documented under the wrong names in the specification.
  • pcache_with_counter rejected valid arguments on 32-bit platforms.

1.1.0 - Introduction of the REPL utility

Choose a tag to compare

@RuiNelson RuiNelson released this 29 Apr 22:57
docs(repl): complete README with full command reference

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

1.0.0 - First Version

Choose a tag to compare

@RuiNelson RuiNelson released this 29 Apr 03:52
docs: rewrite README