Skip to content

CCIP-11474 configure Aggregator/Indexer PG connection#1129

Open
bukata-sa wants to merge 5 commits into
mainfrom
ccip-11474/indexer-pg
Open

CCIP-11474 configure Aggregator/Indexer PG connection#1129
bukata-sa wants to merge 5 commits into
mainfrom
ccip-11474/indexer-pg

Conversation

@bukata-sa
Copy link
Copy Markdown
Collaborator

@bukata-sa bukata-sa commented May 21, 2026

https://smartcontract-it.atlassian.net/browse/CCIP-11474

Description

Adds configurable PostgreSQL connection pool lifetime and idle timeout settings for the indexer. This wires the new settings through config and storage initialization so DB connections can be recycled more safely and predictably. Also updates related tests to match the new constructor signatures.

Testing

Didn't test with devenv, this is just a config update with sane defaults

Checklist

  • Breaking changes documented in changelog (see changelog directory)
  • Cross link related PRs (in this or other repositories)
  • just lint fix - no new lint errors
  • just generate - mocks and protobufs are up to date

@bukata-sa bukata-sa force-pushed the ccip-11474/indexer-pg branch from af63bd6 to ec35abf Compare May 21, 2026 15:59
@bukata-sa bukata-sa marked this pull request as ready for review May 21, 2026 17:44
@bukata-sa bukata-sa requested a review from a team as a code owner May 21, 2026 17:44
Copilot AI review requested due to automatic review settings May 21, 2026 17:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the indexer for configuring PostgreSQL connection pool recycling via ConnMaxLifetime and ConnMaxIdleTime, wiring these settings through config validation and into storage initialization paths (including replay).

Changes:

  • Extend indexer Postgres config with connection max lifetime and max idle time settings (with validation/defaulting).
  • Thread the new settings into NewPostgresStorage and replay.NewStoreFromConfig so pools apply the recycling policy.
  • Update affected call sites and constructor-signature tests.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
indexer/pkg/storage/postgres.go Extends storage constructor to apply SetConnMaxLifetime / SetConnMaxIdleTime on the DB pool.
indexer/pkg/storage/postgres_test.go Updates constructor calls to include the new duration parameters.
indexer/pkg/replay/store.go Extends replay store constructor to apply pool lifetime/idle settings.
indexer/pkg/config/config.go Adds new Postgres config fields and validation/defaulting logic.
indexer/cmd/replay/main.go Wires new config values into replay store and indexer storage creation.
indexer/cmd/main.go Wires new config values into indexer storage creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indexer/pkg/config/config.go Outdated
Comment thread indexer/pkg/config/config.go Outdated
Comment thread indexer/pkg/config/config.go
@bukata-sa bukata-sa force-pushed the ccip-11474/indexer-pg branch 4 times, most recently from 52d712a to 09abf91 Compare May 22, 2026 12:50
@bukata-sa bukata-sa changed the title CCIP-11474 configure Indexer PG connection CCIP-11474 configure Aggregator PG connection May 22, 2026
@bukata-sa bukata-sa changed the title CCIP-11474 configure Aggregator PG connection CCIP-11474 configure Indexer PG connection May 22, 2026
@bukata-sa bukata-sa changed the title CCIP-11474 configure Indexer PG connection CCIP-11474 configure Aggregator/Indexer PG connection May 22, 2026
@bukata-sa bukata-sa force-pushed the ccip-11474/indexer-pg branch 2 times, most recently from b320345 to 78d1fcb Compare May 22, 2026 17:15
@bukata-sa bukata-sa requested a review from a team as a code owner May 22, 2026 17:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Comment thread indexer/pkg/config/config_test.go Outdated
Comment thread indexer/pkg/config/config_test.go Outdated
Comment thread common/toml.go Outdated
bukata-sa and others added 3 commits May 25, 2026 14:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

Code coverage report:

Package main ccip-11474/indexer-pg Diff
github.com/smartcontractkit/chainlink-ccv/aggregator 49.10% 49.33% +0.23%
github.com/smartcontractkit/chainlink-ccv/bootstrap 54.14% 54.14% +0.00%
github.com/smartcontractkit/chainlink-ccv/cli 65.13% 65.13% +0.00%
github.com/smartcontractkit/chainlink-ccv/cmd 15.54% 15.54% +0.00%
github.com/smartcontractkit/chainlink-ccv/common 54.76% 54.76% +0.00%
github.com/smartcontractkit/chainlink-ccv/executor 45.97% 45.97% +0.00%
github.com/smartcontractkit/chainlink-ccv/indexer 37.64% 37.74% +0.10%
github.com/smartcontractkit/chainlink-ccv/integration 45.93% 45.93% +0.00%
github.com/smartcontractkit/chainlink-ccv/pkg 84.62% 84.62% +0.00%
github.com/smartcontractkit/chainlink-ccv/pricer 0.00% 0.00% +0.00%
github.com/smartcontractkit/chainlink-ccv/protocol 65.88% 65.88% +0.00%
github.com/smartcontractkit/chainlink-ccv/verifier 34.48% 34.48% +0.00%
Total 46.50% 46.50% +0.00%

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