Skip to content

Relationship update request may query read-only replica #1110

Closed
@bart-degreed

Description

@bart-degreed

This bug affects APIs that use a master database to write changes to while using a set of read-only replicates to serve GET requests.

The query to determine initial state is sent to the read-only database on POST Many-to-many and DELETE To-many relationship requests.

Affected code:

IReadOnlyCollection<TResource> leftResources = await _repositoryAccessor.GetAsync<TResource>(queryLayer, cancellationToken);

Instead it should call:

_repositoryAccessor.GetForUpdateAsync()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions