clawdie-ai/.agent/skills/postgres-memory/references/layout.md
Clawdie AI 3202aa18a1 docs: update stale SQLite, Paperclip, and two-database references across all docs (Sam & Claude)
POSTGRES-PERMISSIONS.md: two databases -> three (skills, memory, ops).
postgres-memory/layout.md: remove stale 'SQLite remains' statement.
SKILLS-ARTIFACT-V1-PLAN.md: clean up SQLite references.
REFACTOR-PLAN.md: SQLite + PostgreSQL -> PostgreSQL only.
README_zh.md: replace NanoClaw-era architecture diagram and FAQ
with Clawdie's FreeBSD/jail/PostgreSQL architecture.
install.html: add operational state to split-brain description.
CONTROLPLANE-AIDER-PI.md: update next steps.
AGENTS.md: replace negative Paperclip instruction with positive
controlplane description.

---
Build: pass | Tests: not run (Linux)
2026-04-11 21:52:42 +02:00

1.7 KiB

Layout and Snapshots

Jail

  • jail name: db
  • hostname: db.<agent>.home.arpa
  • IP: ${AGENT_SUBNET_BASE}.3
  • role: persistent database service
  • provisioning: thick

ZFS expectations

PostgreSQL on ZFS has two different tuning layers:

  1. pool/vdev sector alignment
  2. dataset-level properties

Pool/vdev alignment

ashift belongs to the pool/vdev layer, not the dataset.

Important:

  • it should match the real sector size of the underlying device
  • for modern 4 KiB devices, that usually means ashift=12
  • it cannot be changed later on an existing pool/vdev

Validate the real pool before assuming PostgreSQL storage is correct.

Dataset-level tuning

Conservative starting properties for PostgreSQL data:

  • compression=lz4
  • atime=off
  • recordsize=16K

Why recordsize=16K:

  • OpenZFS explicitly calls out recordsize for database workloads
  • PostgreSQL uses 8 KiB pages by default
  • 16K is a conservative starting point that stays near PostgreSQL access patterns and avoids the default 128K record size

Treat 16K as an initial operational default. Revisit it with benchmarks later.

The jail dataset should be snapshotted at these points:

  1. after clean jail creation
  2. after PostgreSQL 17 is installed and starts
  3. before schema migration
  4. before schema import

Suggested snapshot names

  • @fresh
  • @postgres17-ready
  • @pre-schema
  • @post-extensions

Design note

All operational data lives in PostgreSQL (ops database). The memory database holds user/agent memories and the skills database holds preloaded knowledge.

This PostgreSQL jail is the live split-brain backend for Agent System Skills, User/Agent Memory, and Operational State across three databases.