[3.0.4 Backport] Periodic high response times on REST API due to persistent config polling

Description

Overview

The persistent config code that checks for config updates periodically (every 10 seconds by default) acquires a lock on ServerContext prior to discovering/fetching database configs from buckets, despite not needing the lock until SG is about to apply the configs.

This can cause REST API response times to periodically spike up to a few seconds if the requests align with the ServerContext lock, whilst SG is fetching database configs from each bucket on server.

Example

Proposed fix

Move the lock in fetchAndLoadConfigs down to after we've fetched the configs from the bucket, but before we're about to apply them to the node.

Activity

Show:

Ben Brooks February 15, 2023 at 2:20 PM

bulk close resolves issues

CB robot August 4, 2022 at 6:31 PM

Build sync_gateway-3.0.4-4 contains sync_gateway commit b806361 with commit message:
: Backport : Fix periodic high response times on REST API due to persistent config polling (#5672)

Ben Brooks July 15, 2022 at 5:01 PM

Make sure the backport includes the follow up fixes to be made in - see comments.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Story Points

Components

Sprint

Fix versions

Affects versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created July 1, 2022 at 11:53 AM
Updated August 31, 2024 at 11:01 AM
Resolved August 4, 2022 at 4:58 PM
Instabug