[MONGOCRYPT-317] listCollections is repeatedly requested when no JSON schema is configured Created: 12/Apr/21  Updated: 28/Oct/23  Resolved: 03/Sep/21

Status: Closed
Project: Libmongocrypt
Component/s: C library
Affects Version/s: None
Fix Version/s: 1.2.2

Type: Bug Priority: Major - P3
Reporter: Kevin Albertson Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: rp-track
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PYTHON-2909 [pymongocrypt] Bundle libmongocrypt 1... Closed
Related
is related to NODE-3262 CSFLE performance issue (10x times sl... Closed
Case:

 Description   

Automatic encryption unnecessarily requests listCollections on a collection with no JSON schema configured.

libmongocrypt checks if a collection has a JSON schema configured by doing the following:
1. Checks if there is an entry in the locally configured schema map.
2. Checks if there is a cached schema obtained from a previous listCollections reply.

libmongocrypt will cache the response for a collection that does not have a JSON schema configured.
https://github.com/mongodb/libmongocrypt/blob/91d2a11bea3569d46001a3a3ef57161bd3706eab/src/mongocrypt-ctx-encrypt.c#L104

However, the check for a cached response does not account for collections that have no schema configured. The absense of a configured schema should still be cached.
https://github.com/mongodb/libmongocrypt/blob/91d2a11bea3569d46001a3a3ef57161bd3706eab/src/mongocrypt-ctx-encrypt.c#L895

This results in drivers repeatedly requesting listCollections unnecessarily.



 Comments   
Comment by Githook User [ 03/Sep/21 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: MONGOCRYPT-317 cache listCollections results with no JSON schema (#190)
Branch: master
https://github.com/mongodb/libmongocrypt/commit/8eeeee95d30f577376fe3682ddd26dcd458ed54d

Comment by Kevin Albertson [ 02/Sep/21 ]

PR: https://github.com/mongodb/libmongocrypt/pull/190

Comment by Esha Bhargava [ 19/Apr/21 ]

 

 

Generated at Thu Feb 08 09:08:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.