Repository navigation
Sync plugin settings and status across replicas - #1658
efegokdemir wants to merge 3 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? |
|
Hello, any updates here? Must have feature for the Kubernetes HA deployments |
LinkinStars
left a comment
There was a problem hiding this comment.
Thanks for updating the implementation along the direction we discussed. The one-minute status TTL, independent configuration refresh, direct database reads, and conditional status updates match our expectations.
We tested against Docker MySQL 8.4.13 with official Redis, Meilisearch, memory vector-search, captcha, OAuth, S3 storage/CDN, and Slack plugins. Existing configuration loading, existing-user login after upgrading from dev, immediate local updates, and cross-replica refresh were verified. Google/OAuth/S3/embedding upstreams used local test endpoints; Redis and Meilisearch used real services. We did not send notifications or upload to real cloud services.
I have attached inline comments for the remaining activation-lifecycle, reload-thread-safety, and lock-scope concerns, including the reproduced behavior and suggested direction. As noted inline, some lifecycle and plugin-thread-safety gaps already exist in older local-update paths; they should not all be described as new regressions.
Please also document the rolling-upgrade limitation: in our real HTTP test, a still-running dev replica overwrote a newer replica's status changes with its whole stale snapshot. Plugin status changes should be avoided until all replicas have been upgraded; the new conditional writer cannot prevent an old unconditional writer from doing this.
Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
Fixes #1657
Proposed Changes
Limitations
Enabling or disabling a cache plugin updates the status/config snapshot, but
data.Cacheselects its backend during process startup. Restart the instance for cache selection changes to take effect.Tests:
go test ./internal/service/plugin_common ./internal/repo/config ./plugin/... ./internal/controller_adminpassed. Targetedgolangci-lint runreported 0 issues.