-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fix machine_type unique constraint to support a machine_type for multiple sites #220
Conversation
Codecov Report
@@ Coverage Diff @@
## master #220 +/- ##
=======================================
Coverage 99.55% 99.56%
=======================================
Files 41 41
Lines 1810 1823 +13
=======================================
+ Hits 1802 1815 +13
Misses 8 8
Continue to review full report at Codecov.
|
997a796
to
e6182c6
Compare
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.
Thanks for catching and fixing both issues!
I have some comments/requests on code health but nothing major.
By the way, my SQL is quite a bit rusty. I think the |
Actually, it is not needed. The code is only called when the |
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.
INSERT INTO tardis
This pull request fixes a bug in the database schema of the
SqliteRegistry
plugin. In the current schema it was not possible to have the very sameMachineTypes
on differentSites
, since the unique constraints put on the database table were too strict. This pull request introduces a more relaxed unique constraint, that requires only the combination (MachineType
,Site
) to be unique.In addition, this pull request introduces a more relaxed unique constraint on the
Resources
table, too. Now it is possible that the sameremote_resource_uuid
can be used at different sites within the same table. This was not mentioned in #219, but could lead to further trouble in the future. For example, two HTCondor batch systems at different sites can have the same job number used asremote_resource_uuid
.In addition, the unittest of the
SqliteRegistry
have been improved by adding both scenarios mentioned above and de-duplicate some of the test code.Fixes #219