avatar

PaulRz

Building Software That Lasts

The Curious Case of Dave and the AWOL Secondary Node

Disclaimer: This fairy tale is generated by ChatGPT based on true story. Once upon a time in the quirky land of Databasia, there existed a splendid PostgreSQL cluster. It was a harmonious symphony of data, with a Primary node leading the ensemble and a Secondary node providing the sweet, reassuring notes of redundancy. Life was good, data flowed seamlessly, and administrators everywhere slept soundly. However, every paradise has its serpent. In this case, it was a curious admin named Dave.

PostgreSQL and updates

In many database applications, particularly in workflow systems, there’s a common requirement to update the status of records. These statuses could range from “ready to process” to “processing,” “done,” “reprocessing,” or even “urgently needed to be processed.” While updating a row may seem trivial in some databases like Oracle, it becomes more complex and nuanced in PostgreSQL. What may appear as a simple status change at the application level actually involves several hidden processes that can lead to performance degradation over time.

OpenZFS and Ubuntu tweaks

Recently, I embarked on a project to optimize my home server setup by transitioning my disk storage pool from RAID5 using mdadm and XFS to ZFS RAIDZ-1. Honestly, it’s been a huge improvement in both performance and functionality, and I’m pretty excited about the results so far. My home server functions as a lab environment, where I primarily serve videos, experiment with Kubernetes clusters, and run various virtual machines (VMs) — mostly OpenBSD and FreeBSD instances.