Project

Profile

Help

Issue #1477

closed

With mongoengine models, developers have to manually configure uniqueness constraints for model unit keys

Added by rbarlow almost 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

I was surprised to learn that our Mongoengine conversion requires developers to both identify the unit key, and also install a uniqueness index for it. Pulp's old model code installed the unit key uniqueness constraint for you, so this is a devloper feature regression. Pulp scans the models for the unit key field as is, so it should continue to automatically install uniqueness constraints based on the unit key field.

If we don't do this, it is highly likely that developers will forget to specify the uniqueness constraints in their models as time goes on, which will lead to bugs in code the depends on the constraints. We certainly have code that depends on uniqueness as a technique to work around Mongo's lack of transactions (such as Docker Tags, or the way the resource manager works).

Until this is fixed, I will install a uniqueness constraint on the Docker Tag model to work around it, and the RPM model already seems to have an index being installed.


Related issues

Related to RPM Support - Issue #1476: The RPM models are indexing a lot of fields that don't make sense to have indicesCLOSED - WONTFIXActions

Also available in: Atom PDF