Skip to content

Refactoring of check category connections#905

Merged
kvch merged 2 commits into
mainfrom
feature-share-replication-conn
Jun 24, 2026
Merged

Refactoring of check category connections#905
kvch merged 2 commits into
mainfrom
feature-share-replication-conn

Conversation

@kvch

@kvch kvch commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR refactors the replication category. Now all checks share the same PostgreSQL connection. The new postgres.LazyConn is not thread-safe. It is used for executing checks sequentially.

Once the check finishes, the cleanup function must be called.

Type of Change

Please select the relevant option(s):

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test coverage improvement
  • 🔨 Build/CI changes
  • 🧹 Code cleanup

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Code is well-commented
  • Documentation updated where necessary

@kvch kvch force-pushed the feature-share-replication-conn branch 4 times, most recently from cfc2884 to 506d196 Compare June 24, 2026 13:12
@kvch kvch force-pushed the feature-share-replication-conn branch from 506d196 to 89a8a19 Compare June 24, 2026 13:15
@kvch kvch marked this pull request as ready for review June 24, 2026 13:19
@kvch kvch requested a review from exekias June 24, 2026 13:19
@kvch kvch enabled auto-merge (squash) June 24, 2026 13:50
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/xataio/pgstream/cmd 0.00% (ø)
github.com/xataio/pgstream/internal/postgres 28.78% (-0.53%) 👎
github.com/xataio/pgstream/pkg/stream/preflight 25.44% (-1.41%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/xataio/pgstream/cmd/check_cmd.go 0.00% (ø) 35 (+3) 0 35 (+3)
github.com/xataio/pgstream/internal/postgres/pg_lazy_conn.go 0.00% (ø) 10 (+10) 0 10 (+10)
github.com/xataio/pgstream/pkg/stream/preflight/builder.go 0.00% (ø) 31 (+10) 0 31 (+10)
github.com/xataio/pgstream/pkg/stream/preflight/replication.go 0.00% (ø) 42 (-4) 0 42 (-4)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@kvch kvch merged commit 4952f07 into main Jun 24, 2026
8 checks passed
@kvch kvch deleted the feature-share-replication-conn branch June 24, 2026 13:54
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