Issue #1395
By default, all our MongoEngine QuerySets cache query results
Description
This problem is found in all our QuerySet usage, but falls into two distinct categories:
- The QuerySets from our models.
- The custom QuerySets we have.
The solution is to ensure that all our models use the QuerySetNoCache class rather than the QuerySet class, and that our custom QuerySets inherit from QuerySetNoCache. Finally, we should remove all uses of ``no_cache()`` in our current code.
Associated revisions
Revision 5a361a8c
View on GitHub
Change all QuerySet objects to be QuerySetNoCache objects.
In order to not cache query results by default, all models must use QuerySet objects that are subclasses of QuerySetNoCache. This modifies all our models that don't have custom QuerySet objects to use the QuerySetNoCache by default (by inheriting from AutoRetryDocument) and introduces a superclass for all custom QuerySet classes to use which derives from QuerySetNoCache.
closes #1395
History
#1
Updated by jcline@redhat.com about 5 years ago
- Status changed from NEW to POST
- Assignee set to jcline@redhat.com
#2
Updated by jortel@redhat.com about 5 years ago
- Triaged changed from No to Yes
#3
Updated by jortel@redhat.com about 5 years ago
You Da Man! - triage team
#4
Updated by jcline@redhat.com about 5 years ago
- Checklist item Change AutoRetryDocument to have QuerySetNoCache by default set to Done
- Checklist item Change the custom QuerySets to inherit from QuerySetNoCache set to Done
- Checklist item Remove all occurances of ``no_cache()`` set to Done
#5
Updated by jcline@redhat.com about 5 years ago
#6
Updated by rbarlow almost 5 years ago
- Status changed from POST to 5
- Platform Release set to 2.8.0
#7
Updated by dkliban@redhat.com almost 5 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
#8
Updated by bmbouter almost 2 years ago
- Tags Pulp 2 added
Please register to edit this issue
Change all QuerySet objects to be QuerySetNoCache objects.
In order to not cache query results by default, all models must use QuerySet objects that are subclasses of QuerySetNoCache. This modifies all our models that don't have custom QuerySet objects to use the QuerySetNoCache by default (by inheriting from AutoRetryDocument) and introduces a superclass for all custom QuerySet classes to use which derives from QuerySetNoCache.
closes #1395