Skip to content
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

Get rid of 'profiles' in module_defaults association #70

Merged
merged 2 commits into from
Apr 30, 2019

Conversation

JayZ12138
Copy link
Contributor

Previously, 'profiles' was the key part to get the right modulemd_defaults
units to associate and unassociate. However, as the keyword in profiles
always include speical character '.'(dot), it leads to mongodb query failure.

Since while assmbling the lists of md_defaults_assoc and md_defaults_unassoc,
the 'profiles' has already been considered, we don't have to re-query with
it, but, because association and unassociation happens at the same time in
threads, it could delete the new unit if association happens before unassociation,
so, we serialize the modulemd_defaults units unassociation and association.

rbikar
rbikar previously requested changes Apr 29, 2019
Copy link
Member

@rbikar rbikar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please add test coverage.
  2. Isn't there a way how to pass special chars to mongo query?
  3. Otherwise it looks ok.

@JayZ12138
Copy link
Contributor Author

  1. Please add test coverage.
  2. Isn't there a way how to pass special chars to mongo query?
  3. Otherwise it looks ok.
  1. Yes, I'm adding
  2. No. There isn't any way to pass '.' to query in keyword. The mongodb team is trying to support it.

ubipop/__init__.py Outdated Show resolved Hide resolved
@rohanpm
Copy link
Member

rohanpm commented Apr 30, 2019

  1. No. There isn't any way to pass '.' to query in keyword. The mongodb team is trying to support it.

That's amazing. I almost couldn't believe it, but it's right there in
https://docs.mongodb.com/manual/reference/limits/#Restrictions-on-Field-Names, "The MongoDB Query Language cannot always meaningfully express queries over documents whose field names contain these characters". So Pulp is saving modulemd_defaults units which can't possibly be searched over, it's crazy.

Previously, 'profiles' was the key part to get the right modulemd_defaults
units to associate and unassociate. However, as the keyword in profiles
always include speical character '.'(dot), it leads to mongodb query failure.

Since while assmbling the lists of md_defaults_assoc and md_defaults_unassoc,
the 'profiles' has already been considered, we don't have to re-query with
it, but, because association and unassociation happens at the same time in
threads, it could delete the new unit if association happens before unassociation,
so, we serialize the modulemd_defaults units unassociation and association.
@JayZ12138 JayZ12138 merged commit 1def2f8 into release-engineering:master Apr 30, 2019
@JayZ12138 JayZ12138 deleted the 6738-2 branch April 30, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants