Problem
Sharing group and member updates currently call sharing.FindActive, which
queries the active index with a limit of 1,000 documents, and then filters
the returned sharings in Go.
This pattern is used for:
- contact additions and removals in shared groups
- group metadata updates
- deleted group revocation
- member matching for invitation updates
On instances with more than 1,000 active sharings, matching sharings can be
omitted and group or member updates may not be propagated.
The sharing doctype currently has an index only on active. Group IDs are
stored in groups[].id, while member identities are stored in fields such as
members[].email and members[].instance.
Expected improvement
- Add suitable CouchDB indexes or indexed denormalized fields for sharing
group IDs and member identities.
- Add sharing lookup helpers that query only the relevant active sharings by
group or member.
- Replace full
FindActive scans in group and member event paths where
possible.
- Ensure all matching sharings are processed on databases containing more
than 1,000 active sharings.
- Add regression tests covering group and member lookups beyond the current
query limit.
Problem
Sharing group and member updates currently call
sharing.FindActive, whichqueries the
activeindex with a limit of 1,000 documents, and then filtersthe returned sharings in Go.
This pattern is used for:
On instances with more than 1,000 active sharings, matching sharings can be
omitted and group or member updates may not be propagated.
The sharing doctype currently has an index only on
active. Group IDs arestored in
groups[].id, while member identities are stored in fields such asmembers[].emailandmembers[].instance.Expected improvement
group IDs and member identities.
group or member.
FindActivescans in group and member event paths wherepossible.
than 1,000 active sharings.
query limit.