Fixed
Pinned fields
Click on the next to a field label to start pinning.
Details
Assignee
Adam FraserAdam FraserReporter
Ben BrooksBen BrooksLabels
Story Points
3Components
Sprint
NoneFix versions
Priority
MajorInstabug
Open Instabug
Details
Details
Assignee
Adam Fraser
Adam FraserReporter
Ben Brooks
Ben BrooksLabels
Story Points
3
Components
Sprint
None
Fix versions
Priority
Instabug
Open Instabug
PagerDuty
PagerDuty
PagerDuty
Sentry
Sentry
Sentry
Zendesk Support
Zendesk Support
Zendesk Support
Created June 30, 2022 at 5:14 PM
Updated August 31, 2024 at 10:58 AM
Resolved October 17, 2022 at 5:06 PM
Overview
Sync Gateway's ServerContext contains a reference to a "BootstrapConnection" interface, which has 4 methods:
List available buckets
Get, Insert, and Update a database config within a given bucket
The current persistent config implementation (CouchbaseCluster) opens a new SDK connection for each operation it does (list buckets, get config, etc.)
This was to work around an issue where a single SDK connection cannot operate on different buckets, but is too expensive to open for each operation we do (~2 seconds)
Proposed implementation
At a high-level, we should make the implementation initialize connections for a) the cluster (to list buckets), and b) for each bucket we find/use.
We need to handle the cases where:
buckets are dropped or added to the server whilst this code is still running
We can probably do this by making "GetConfigBuckets" add/remove connections to buckets based on the list returned
the connection is dropped, due to a network blip
It might be that on an error, we retry, or we just log about it, remove the now invalid connection reference, and let the code re-initialize it
We don't need to consider using these bucket connections for other SG database operations, as those can use different authentication credentials than the bootstrap/config process.
Acceptance criteria
Functionality remains the same.
As a side-effect, persistent config loads are quicker as they do not need to set up an entirely new SDK connection every time...
Handles the above exceptional cases gracefully (bucket added/removed, connection drops) without needing to restart SG