Skip to content

release(pg_tle): preserve data across 0.3 upgrades - #333

Draft
NikolayS wants to merge 5 commits into
mainfrom
agent/fix-tle-upgrade
Draft

release(pg_tle): preserve data across 0.3 upgrades#333
NikolayS wants to merge 5 commits into
mainfrom
agent/fix-tle-upgrade

Conversation

@NikolayS

Copy link
Copy Markdown
Owner

Summary

  • register the 0.3 standalone pg_tle version, tested 0.2.0 → 0.3 update path, and new default atomically
  • stop directing unknown upgrade paths toward destructive uninstall
  • add a real 0.2.0 TLE fixture with queue, subscription, pending, retry, and DLQ state
  • verify ALTER EXTENSION preserves all state and activates the new send_idem API
  • document the explicit registration/update sequence

Fixes #308.

Validation

  • reproduced the old wrapper rejecting a live 0.2.0 extension and recommending uninstall
  • real pg_tle v1.5.2 0.2.0 → 0.3.0-devel update test passed
  • fresh pg_tle install, rerun, drop, and idempotent unregister test passed
  • full tests/run_all.sql passed through a fresh pg_tle install
  • generator ran twice with identical output hashes
  • bash -n build/transform.sh and git diff --check passed

actionlint reports only the workflow's pre-existing shellcheck warnings; the added CI step introduces no new warning.

@NikolayS NikolayS left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REV rubric review

This is a manual execution of the repository's five applicable REV rubrics because the automated ultrareview quota was unavailable. It is not bot output. SOC2 was omitted.

  • Bug/security: known updates preserve state and unknown paths refuse destructive guidance; no additional high-confidence defect or security issue found.
  • Tests: real pg_tle update/fresh/repeat/unsupported paths are covered; CI is 17/17 green. Initial RED is retrospective.
  • Docs/guidelines: final transform shell hardening resolves the touched-file IFS gap. Historical release: is unsupported by both rule sets and exactly 50 characters; test:/style: also conflict with the repo-specific list.

Blocking patch findings: none. Remaining constraints: preserve history, use a compliant squash/merge subject/title, and post real pg_tle evidence before merge. This COMMENT review is not an approval.

@NikolayS

Copy link
Copy Markdown
Owner Author

Real-user pg_tle verification evidence for head b2f7786f35d90c0030ac868f3708a136da2908fd.

The upgrade test used pg_tle v1.5.2 with a real tagged v0.2.0 extension registration. The documented local sequence was exercised:

PAGER=cat psql --no-psqlrc "$PGQUE_TEST_DSN" \
  --command='create extension pg_tle'
git show v0.2.0:sql/pgque-tle.sql \
  | PAGER=cat psql --no-psqlrc "$PGQUE_TEST_DSN" --set=ON_ERROR_STOP=1
PAGER=cat psql --no-psqlrc "$PGQUE_TEST_DSN" \
  --command='create extension pgque'
PAGER=cat psql --no-psqlrc "$PGQUE_TEST_DSN" --set=ON_ERROR_STOP=1 \
  --file=tests/test_tle_upgrade.sql

tests/test_tle_upgrade.sql builds queue, subscription, pending-event, retry, and DLQ state, registers the new version/update path, runs ALTER EXTENSION pgque UPDATE, then exercises the new send_idem API. The pre-fix wrapper rejected the live extension and instructed the user to uninstall:

ERROR: pgque is already registered with pg_tle at version 0.2.0 but this script registers version 0.3.0-devel. Run devel/sql/pgque-tle-uninstall.sql first ...

The head passed:

NOTICE: pgque 0.3.0-devel already registered with pg_tle; no registration changes needed.
PASS: 0.2.0 pg_tle state survived and 0.3 APIs work
=== test_tle_upgrade: ALL PASSED ===

I also exercised an unsupported 0.1.0 path. It failed without suggesting destructive uninstall and preserved the installed state:

ERROR: pgque has no tested pg_tle update path from version 0.1.0 to 0.3.0-devel. Keep the existing extension installed ... do not uninstall it because that would drop queue data.
PASS: unsupported pg_tle update failed without changing state

Fresh pg_tle install, idempotent wrapper rerun, extension drop/unregister, and the full regression suite through the pg_tle install path passed. bash build/transform.sh produced identical generated output on repeat; bash -n build/transform.sh, ShellCheck for the changed shell, and git diff --check passed.

RED/GREEN chronology: retrospective. The main pg_tle upgrade regression was added after the implementation rather than as a published RED commit. I independently confirmed the pre-fix rejection and the head's GREEN behavior.

Full CI: 17/17 checks passed.

This comment records test evidence only; it is not a review or merge decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

release(pg_tle): add a data-preserving 0.2.0 to 0.3.0 update path

1 participant