Skip to content

Allow zodan add_node to work with lolor large object data.#523

Draft
mason-sharp wants to merge 1 commit into
mainfrom
fix/SPOC-613/zodan-lolor
Draft

Allow zodan add_node to work with lolor large object data.#523
mason-sharp wants to merge 1 commit into
mainfrom
fix/SPOC-613/zodan-lolor

Conversation

@mason-sharp

@mason-sharp mason-sharp commented Jul 9, 2026

Copy link
Copy Markdown
Member

Permit the new node to have lolor installed as long as its tables are empty, and require it when the source replicates lolor tables. Keep lolor out of create_sub's auto-detected skip_schema so the initial data sync copies the large object data. Add a TAP test covering the rejection cases and end-to-end sync.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

ZODAN now treats lolor separately from user schemas during node addition, validates extension and large-object compatibility, and excludes extension-owned tables from fresh-database checks. Shared TAP setup and a scheduled three-node integration test cover failure and successful replication paths.

lolor Node Addition

Layer / File(s) Summary
ZODAN lolor prerequisite checks
samples/Z0DAN/zodan.sql
Schema discovery and emptiness checks exclude lolor; node prerequisites and health checks validate extension presence and empty large-object tables.
Shared lolor test setup
tests/tap/t/SpockTest.pm, tests/tap/t/032_lolor_largeobject_repset.pl
ensure_lolor is exported and used by the existing large-object replication test.
lolor node-add integration coverage
tests/tap/t/033_zodan_lolor_add_node.pl, tests/tap/schedule
A scheduled three-node test covers missing-extension and pre-existing-data failures, initial synchronization, and subsequent streaming replication.

Poem

A rabbit checks the tables bright,
“No stray blobs before takeoff tonight!”
ZODAN joins nodes in a row,
Large objects stream and glow.
lolor hops through every flight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title directly matches the main change: enabling zodan add_node to handle lolor large-object data.
Description check ✅ Passed The description accurately summarizes the lolor validation, create_sub adjustment, and TAP test additions.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/SPOC-613/zodan-lolor

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mason-sharp mason-sharp requested a review from ibrarahmad July 9, 2026 21:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
samples/Z0DAN/zodan.sql (1)

1149-1194: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Lolor prerequisite checks look correct; consider extracting shared logic.

The three-stage check (extension presence → table emptiness → source repset requirement) is logically sound and the error messages are actionable. The pg_tables exclusion of lolor at lines 1192-1194 correctly prevents extension-owned tables from triggering the "fresh database" guard.

However, this lolor check logic is duplicated in health_check (lines 2700-2736). The two implementations differ only in error handling (RAISE EXCEPTION vs checks_failed increment). If the check criteria evolve, one copy may be updated without the other, leading to inconsistent behavior between add_node and health_check.

Consider extracting a shared helper function (e.g., spock.check_lolor_compatibility) that returns a status enum or record, letting each caller decide how to report the result.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@samples/Z0DAN/zodan.sql` around lines 1149 - 1194, The lolor prerequisite
logic is duplicated between the add_node check and health_check, so update the
implementation to use a shared helper instead of maintaining two separate
copies. Extract the extension presence, table emptiness, and source repset
validation into a common function such as spock.check_lolor_compatibility, and
have both add_node and health_check call it while preserving their different
failure reporting behavior. Keep the existing checks around new_lolor_installed,
lolor_row_count, and src_lolor_repset_tables, but centralize the criteria in one
place so future changes stay consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@samples/Z0DAN/zodan.sql`:
- Around line 1149-1194: The lolor prerequisite logic is duplicated between the
add_node check and health_check, so update the implementation to use a shared
helper instead of maintaining two separate copies. Extract the extension
presence, table emptiness, and source repset validation into a common function
such as spock.check_lolor_compatibility, and have both add_node and health_check
call it while preserving their different failure reporting behavior. Keep the
existing checks around new_lolor_installed, lolor_row_count, and
src_lolor_repset_tables, but centralize the criteria in one place so future
changes stay consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 16f6e2f7-d75c-4892-bb13-83d8be0163d3

📥 Commits

Reviewing files that changed from the base of the PR and between a11ae76 and 5ce019a.

📒 Files selected for processing (5)
  • samples/Z0DAN/zodan.sql
  • tests/tap/schedule
  • tests/tap/t/032_lolor_largeobject_repset.pl
  • tests/tap/t/033_zodan_lolor_add_node.pl
  • tests/tap/t/SpockTest.pm

Permit the new node to have lolor installed as long as its tables are
empty, and require it when the source replicates lolor tables. Keep
lolor out of create_sub's auto-detected skip_schema so the initial data
sync copies the large object data. Add a TAP test covering the
rejection cases and end-to-end sync.
@mason-sharp mason-sharp force-pushed the fix/SPOC-613/zodan-lolor branch from 24cc4d5 to 13d703f Compare July 14, 2026 21:05
@mason-sharp mason-sharp marked this pull request as draft July 15, 2026 22:46
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.

2 participants