Skip to content

Sync plugin settings and status across replicas - #1658

Open
efegokdemir wants to merge 2 commits into
apache:devfrom
efegokdemir:efe/plugin-settings-sync
Open

efegokdemir wants to merge 2 commits into
apache:devfrom
efegokdemir:efe/plugin-settings-sync

Conversation

@efegokdemir

Copy link
Copy Markdown

Fixes #1657

Proposed Changes

  • Refresh plugin status and configuration from the database every 10 seconds on each instance.
  • Use a conditional update for plugin status so concurrent changes from other instances are preserved.

Tests: go test ./internal/service/plugin_common ./internal/repo/config ./plugin/... ./internal/controller_admin passed. Targeted golangci-lint run reported 0 issues.

@LinkinStars
LinkinStars changed the base branch from main to dev November 5, 2026 08:56
@LinkinStars

Copy link
Copy Markdown
Member

Thanks for working on the cross-replica plugin sync. Reading the persisted status before a conditional update is a useful fix for concurrent changes.

Could we consider reducing the continuous database polling in this PR? Each replica currently reads the status and the full plugin-config table every 10 seconds. A possible alternative is to keep a local status snapshot with a roughly one-minute TTL: use it for normal plugin checks, and refresh the whole snapshot from the database on the first check after it expires. Plugin configuration would still need its own less frequent refresh (for example, every minute), since loading a status value alone does not call ConfigReceiver or update the plugin's in-process state. A delay of up to about one minute for changes to reach other replicas would be acceptable to us.

I would keep the database as the source of truth and retain the conditional status update. Even with a shared cache, reading status from it would not apply configuration to plugin instances. If you pursue the TTL approach, please retain the explicit startup load, bypass the config cache for refreshes, coalesce concurrent expired reads, and ensure a failed or older refresh cannot overwrite a successful local update.

What do you think of this direction?

This branch has not been deployed

No deployments
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.

Plugin settings changes don’t reach other instances in a multi-replica setup

2 participants