Persist opted-in payment processor data with PostgreSQL #38

Merged
asmo merged 2 commits from feat/persistent-processor-data into main 2026-10-19 17:49:04 +00:00
Owner

A stateful gRPC payment processor can need durable local data even when the mint ledger uses PostgreSQL. Currently that combination mounts emptyDir, so replacing the pod discards the processor's local state.

Add the opt-in CashuMint annotation mint.cashu.asmogo.github.io/persist-processor-data: "true". With an enabled processor sidecar, reconcile and mount the existing data PVC, select Recreate, and reject more than one replica. Existing behavior remains unchanged without the annotation; no CRD changes are required.

Include regression tests and generic migration guidance. This does not copy existing data or convert database formats: installations must preserve and restore existing processor state before activating the annotation. Recreate prevents overlap during normal rollouts, not force deletion or independently started wallet instances.

Validation: go test ./internal/controller/generators ./internal/controller -count=1 passed with Kubernetes 1.34.1 envtest assets, including the full local API-server suite. git diff --check passed.

Prepared against current main (v0.4.2 baseline). This PR does not publish a release or deploy anything; it can be included in a subsequent v0.4.3 release after review.

A stateful gRPC payment processor can need durable local data even when the mint ledger uses PostgreSQL. Currently that combination mounts emptyDir, so replacing the pod discards the processor's local state. Add the opt-in CashuMint annotation `mint.cashu.asmogo.github.io/persist-processor-data: "true"`. With an enabled processor sidecar, reconcile and mount the existing data PVC, select Recreate, and reject more than one replica. Existing behavior remains unchanged without the annotation; no CRD changes are required. Include regression tests and generic migration guidance. This does not copy existing data or convert database formats: installations must preserve and restore existing processor state before activating the annotation. Recreate prevents overlap during normal rollouts, not force deletion or independently started wallet instances. Validation: `go test ./internal/controller/generators ./internal/controller -count=1` passed with Kubernetes 1.34.1 envtest assets, including the full local API-server suite. `git diff --check` passed. Prepared against current main (v0.4.2 baseline). This PR does not publish a release or deploy anything; it can be included in a subsequent v0.4.3 release after review.
Persist opted-in payment processor data with PostgreSQL
Some checks are pending
Lint / Run on Ubuntu (pull_request) Has started running
Docs / Build docs site (pull_request) Successful in 1m0s
E2E Tests / Run on Ubuntu (pull_request) Has started running
Tests / Run on Ubuntu (pull_request) Has started running
3db536b7fd
Fix persistence regression test lint
All checks were successful
Docs / Build docs site (pull_request) Successful in 57s
Lint / Run on Ubuntu (pull_request) Successful in 9m35s
Tests / Run on Ubuntu (pull_request) Successful in 10m37s
E2E Tests / Run on Ubuntu (pull_request) Successful in 17m33s
23773111dc
asmo merged commit 863376db44 into main 2026-10-19 17:49:04 +00:00
Sign in to join this conversation.
No description provided.