Repository navigation
Sync plugin settings and status across replicas - #1658
efegokdemir wants to merge 2 commits into
Conversation
|
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 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? |
Fixes #1657
Proposed Changes
Tests:
go test ./internal/service/plugin_common ./internal/repo/config ./plugin/... ./internal/controller_adminpassed. Targetedgolangci-lint runreported 0 issues.