Why host is showing 100% used space of empty postgres datastore mounted by Persistent Volume Claim (PVC)
Applies to
- Astra Trident
- Kubernetes
- SolidFire
- Postgres
Answer
Postgres writes regulary WAL (Write Ahead Logs). This WAL files are allocating 16MB space on the filesystem, but the file itself contains only zeros until something is written. Even if nothing is written and the file remains completely zeroed, additional files are created. As SolidFire is ignoring those zeros, the result is 100% filled file system and only 6% filed volume on SolidFire
Additional Information
SolidFire storage is using thin provisioning by default. Host or pod doesn't know it's thin, so they prented it's a full disk.The PVC claims 100% of the Persistent Volume (PV)
Example
# df -h | grep pvc-66d6dcb7-4b2c-4adb-90f6-604cc49d671a
/dev/mapper/36f47acc10000000034796a650000025a 16G 15G 0 100% /var/lib/kubelet/pods/f0463b03-5fca-4f3a-a4f2-71d4ca38e16d/volumes/kubernetes.io~csi/pvc-66d6dcb7-4b2c-4adb-90f6-604cc49d671a/mount
while SF storage is showing only 6% used:
This case scenario is typical for postgres. The value of used space on a host might not be always 100%