Skip to content

Instantly share code, notes, and snippets.

View IgorOhrimenko's full-sized avatar

Igor Ohrimenko IgorOhrimenko

View GitHub Profile
@IgorOhrimenko
IgorOhrimenko / cleanup.sh
Created March 31, 2026 15:43
CNPG Timeline WAL Bug Reproducer - cloudnative-pg/cloudnative-pg#10394
#!/bin/bash
# Cleanup: delete kind cluster
kind delete cluster --name cnpg-bug
echo "Cluster deleted."
@IgorOhrimenko
IgorOhrimenko / pgdog-rss-repro-stand.yaml
Created July 16, 2026 21:50
PgDog RSS-retention repro stand (jemalloc dirty pages / background_thread) — see pgdogdev/pgdog issue
# PgDog RSS-retention reproduction stand (Kubernetes).
# See pgdogdev/pgdog issue: RSS not returned to OS after bursts of large messages.
#
# kubectl apply -f pgdog-rss-repro-stand.yaml
# # generate a ~3MB client-message load file inside the loadgen pod:
# POD=$(kubectl -n pgdog-lt get pod -l app=loadgen -o name)
# kubectl -n pgdog-lt exec $POD -- sh -c \
# 'printf "SELECT octet_length('\''%s'\'');\n" "$(head -c 3000000 /dev/zero | tr "\0" a)" > /tmp/bigq.sql'
# # drive 500 clients for 80s against the DEFAULT pgdog (balloons and sticks):
# kubectl -n pgdog-lt exec $POD -- env PGPASSWORD=ltpass pgbench -n -c 500 -j 16 -T 80 \
@IgorOhrimenko
IgorOhrimenko / dragonfly-operator spec.additionalVolumeMounts usage patterns.md
Last active July 18, 2026 07:09
dragonfly-operator: spec.additionalVolumeMounts usage patterns (emptyDir crash-protection, read-only warm-up cache, seed+emptyDir combo)

dragonfly-operator: spec.additionalVolumeMounts usage patterns

spec.additionalVolumeMounts mounts extra volumes into the Dragonfly main container. It is the missing counterpart to the existing spec.additionalVolumes (which only adds volumes to the pod, without mounting them). Pairing the two lets you compose several snapshot/cache patterns without any snapshot-specific API — the operator does not need to know what the volume is for.

Status: additionalVolumeMounts is proposed in a fork of dragonfly-operator (based on v1.6.1). additionalVolumes, initContainers and spec.snapshot.dir

@IgorOhrimenko
IgorOhrimenko / README.md
Last active July 22, 2026 09:23
PgDog prepared-statements memory balloon reproduction (unbounded cache, undercounted by SHOW MEMORY, not released)

PgDog memory balloon: unbounded prepared-statement cache (in-use statements are never capped)

A client that opens many distinct server-side prepared statements over the extended protocol and keeps them open makes PgDog's prepared-statement cache grow to gigabytes.

Key points:

  • prepared_statements_limit does not bound this. It only controls eviction of unused statements (per-server-connection LRU, which protects the backend Postgres). In-use statements (still referenced by a connected client, used > 0) are never evicted, so the pgdog-side
@IgorOhrimenko
IgorOhrimenko / README.md
Created July 24, 2026 09:40
PgDog AST query-cache memory balloon — reproduction (query_cache_limit caps count not bytes; heavy queries balloon RSS, held until LRU-evicted; TEC-2911)

PgDog AST query-cache memory balloon

Reproduces a memory balloon in PgDog caused by the AST query cache (query_cache_limit, default 1000), not by prepared statements and not by allocator retention.

The mechanism

PgDog keeps one global LRU cache of parsed query ASTs per process (static CACHE, shared across all clients and all databases the instance