BitPage

Technical blog

BitPage

A technical engineer's blog: real problems, real fixes, real numbers. Backend, databases, infra, incident post-mortems, security, AI-native workflows.

8 articles
7 tracks
36 tags

Recent

Room 3 froze on a suspending @Transaction: the SQLite driver you pass picks your connection pool

Room 3 reads hasConnectionPool off the driver you hand setDriver(). AndroidSQLiteDriver returns true, so Room installs a passthrough pool holding exactly one thread-confined connection, and a suspending @Transaction can block there with no crash, no ANR and nothing in logcat. BundledSQLiteDriver returns false, so Room runs its own pool of four readers and one writer, and resets PRAGMA synchronous on every connection it opens.

How to never pay a generative API twice: a durable task table, not a retrying job queue

The instant you might have been charged is not the provider's response, it is the moment before the request leaves your process. Write it to a row before the HTTP call and a dead worker becomes recoverable without guessing: nothing written means retry is safe, a saved request id means poll, and the gap between them needs a third terminal state.

PostgreSQL index bloat: why VACUUM never shrinks an index, and how to measure it with avg_leaf_density

A b-tree that has lost most of its keys keeps every page it allocated: PostgreSQL reclaims completely empty index pages, but a page with a few keys left on it stays put, and no autovacuum setting changes that. Measure the damage with pgstatindex.avg_leaf_density against the b-tree default fillfactor of 90, predict the recovery as size x density / 90, and fix it with REINDEX rather than VACUUM FULL.

Mass segfaults on a ZFS host: not bad RAM, an unsigned underflow in zfs_fillpage()

A host that answers on no port while the kernel keeps logging is not failing memory. In OpenZFS before 2.4.4 and 2.3.9, zfs_fillpage() computes io_len = i_size - io_off in unsigned types: race an mmap read against an in-place truncate and the length underflows, so dmu_read() zero-fills physical memory far past the page. Fixed on 21 August 2026 in 2.4.4 and 2.3.9 — but not in 2.2.11, released the same minute.

Tracks

Tags