-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplemented labels as HStore field #3427
Conversation
796a5fb
to
6a1a733
Compare
I believe this is going to result in the same kind of downstream impact as the UUID change, which is that plugins with models that inherit directly from |
6a1a733
to
ba43632
Compare
Yes, when we want to introduce it on the |
Is the plan to put it on |
I don't have a final Plan. I can even just put it on the very master models we provide label functionality today. |
a5051ff
to
97cd925
Compare
0506d08
to
7c64ba9
Compare
1cff650
to
26c4a22
Compare
This solves the imminent performance issues. fixes pulp#3400
26c4a22
to
bbadee8
Compare
@@ -273,13 +274,67 @@ class CharInFilter(BaseInFilter, CharFilter): | |||
pass | |||
|
|||
|
|||
class LabelSelectFilter(Filter): | |||
class LabelFilter(Filter): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you thinking about write a test for this filter? (or if makes any sense for testing it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not adding net new functionality here. Tests are here: https://github.com/pulp/pulp_file/blob/main/pulp_file/tests/functional/api/test_labels.py#L125
cc @ggainey
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify for me - we are implementing this at the individual-model-level "for now", for just the models that currently expose labels. "Later", we may rework this to be provided at either Base or Master level, to expand label-access more generally - but that's much more invasive, esp in the migrations, and we want to address the discovered performance-problem "Now". Is that understanding correct?
Other than that - I'll second decko's request for a test for label-filtering.
I'd probably go a bit stronger and say that once we pick an approach realistically we won't be able to back down from it. Django doesn't like moving fields from a child to a parent model table one bit. It can probably be done, but not without a flag day for all plugins, e.g. Pulp 4. |
Well, Django allows us to move the field from the (non-abstract) master models up in the hierarchy to the abstract |
This change looks great. 👍 We considered hstore in the original proposal but I assumed that when the postgresql docs mentioned "rarely examined" data, it probably wasn't indexed but it seems that it is indexed. One thing I wanted to mention though is that the label filter should be able to handle filtering by 6 labels but I suspect there's some problem with the query. It might be worth using
|
Actually it looks like the |
Tests already exist that exercise the changing codepath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get this performance-knee addressed, and this looks like it does the needful. Approved
Maybe an And, do the solution proposed by this PR addresses the performance issues of the |
Yes, it does: And we may eventually decide to even add an index to the hstore field if it's still not sufficiently performant. |
Sorry @mdellweg. The question was not for you. I should have mention @daviddavis. |
Pulpcore 3.22 will start using HStore[1], which is in postgresql-contrib. This ensures it's installed. [1]: pulp/pulpcore#3427
Pulpcore 3.22 will start using HStore[1], which is in postgresql-contrib. This ensures it's installed and enabled on the DB. That needs to be done by a super user, so it can't be done in regular DB migrations. [1]: pulp/pulpcore#3427
Pulpcore 3.22 will start using HStore[1], which is in postgresql-contrib. This ensures it's installed and enabled on the DB. That needs to be done by a super user, so it can't be done in regular DB migrations. [1]: pulp/pulpcore#3427
This solves the imminent performance issues.
fixes #3400