[Debt] Harden materialization storage and concurrent revision allocation #4

Closed
opened 2026-07-28 12:48:19 +02:00 by zemion · 3 comments
Owner

Parent: #1

The first slice intentionally stores bounded rows in JSON and allocates
revisions from the current maximum. Replace those development-scale choices
before large or concurrent production workloads.

Acceptance criteria:

  • transaction-safe monotonic revision allocation under concurrent refresh/promote/freeze
  • durable payload abstraction for database tables, object/file artifacts, and streaming checkpoints
  • no loading of large materializations into process memory for preview or copy
  • checksum and size verification between metadata and payload
  • cleanup/retention remains safe under partial failure
  • PostgreSQL concurrency and failure-injection tests
Parent: https://git.add-ideas.de/GovOPlaN/govoplan-datasources/issues/1 The first slice intentionally stores bounded rows in JSON and allocates revisions from the current maximum. Replace those development-scale choices before large or concurrent production workloads. Acceptance criteria: - transaction-safe monotonic revision allocation under concurrent refresh/promote/freeze - durable payload abstraction for database tables, object/file artifacts, and streaming checkpoints - no loading of large materializations into process memory for preview or copy - checksum and size verification between metadata and payload - cleanup/retention remains safe under partial failure - PostgreSQL concurrency and failure-injection tests
Author
Owner

Codex State: progress

Fresh Xenon output identifies publish_rows (D/22) as the remaining materialization hotspot. Decompose revision allocation, immutable row persistence, staging/finalization, and publication event assembly while implementing this issue's concurrency guarantees. Add competing-publisher and rollback tests before closure.

## Codex State: progress Fresh Xenon output identifies `publish_rows` (D/22) as the remaining materialization hotspot. Decompose revision allocation, immutable row persistence, staging/finalization, and publication event assembly while implementing this issue's concurrency guarantees. Add competing-publisher and rollback tests before closure.
Author
Owner

Codex State: reviewed

Reviewed after the current push. This remains open: materializations still use bounded JSON payloads and max-based revision allocation; transaction-safe concurrent revisions, durable external payload abstractions, streaming/large preview behavior, integrity verification, failure-safe cleanup, and PostgreSQL concurrency tests are not implemented.

## Codex State: reviewed Reviewed after the current push. This remains open: materializations still use bounded JSON payloads and max-based revision allocation; transaction-safe concurrent revisions, durable external payload abstractions, streaming/large preview behavior, integrity verification, failure-safe cleanup, and PostgreSQL concurrency tests are not implemented.
Author
Owner

Implemented and pushed in f3288db. Materializations now use immutable payload metadata plus paged database-row storage, with adapters/reference contracts for object/file/checkpoint backends, metadata and row checksums, streaming full-integrity verification, staged reference-safe deletion, and migration/backfill from legacy JSON. Revision allocation is serialized with a datasource row lock and publication/read hotspots were decomposed. All 15 tests pass; the included two-session PostgreSQL race test is skipped unless GOVOPLAN_DATASOURCES_TEST_POSTGRES_URL is configured. Ruff and Xenon B/B/A pass.

Implemented and pushed in f3288db. Materializations now use immutable payload metadata plus paged database-row storage, with adapters/reference contracts for object/file/checkpoint backends, metadata and row checksums, streaming full-integrity verification, staged reference-safe deletion, and migration/backfill from legacy JSON. Revision allocation is serialized with a datasource row lock and publication/read hotspots were decomposed. All 15 tests pass; the included two-session PostgreSQL race test is skipped unless GOVOPLAN_DATASOURCES_TEST_POSTGRES_URL is configured. Ruff and Xenon B/B/A pass.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-datasources#4