-
Notifications
You must be signed in to change notification settings - Fork 109
Set PNN instead of PSNs for wmbs file locations #8280
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
Conversation
|
Jenkins results:
|
|
Ho ho ho , just 441 failures... |
b2aa6eb to
1c7c1a3
Compare
|
Jenkins results:
|
b7fd144 to
156f39e
Compare
|
Jenkins results:
|
|
And it keeps failing for me on the oracle backend as well: any clue @hufnagel ? |
|
Jenkins results:
|
|
I have no clue what this schema is supposed to be honestly. Doesn't make any sense to me. Location still is mapped to a fixed set of PNNs, but for the file location you don't even store PNN, you store what ? A string that doesn't map to anything ? |
|
Remove location from wmbs_file_location, replace it with a pnn (id) and have a separate table with the allowed list of pnn and a corresponding FK id in the wmbs_location table. |
|
If you still think your schema works, can you give me an example how you would inject data into this ? |
Yes, file location is mapped to a set of PNNs (the pnn string, not their id or mapped location). Cutting a long story short, we no longer map pnn to location and set them as file location. We set PNN(s) as file location and map it to their location when needed.
I'm not sure I follow you. Isn't it exactly what we have at the moment? PNNs with a corresponding FK id in wmbs_location ?
Check these DAOs: they were already using the PNN as query binds (but mapping to a location - aka site_name). |
|
And I think I know why it fails... it seems a foreign key has to reference either a primary key OR a unique key in the parent table. Since wmbs_location_pnns has a many to many mapping, it doesn't work. I guess the only option is really creating another table with unique id and pnns, then keep wmbs_location_pnns just to map location (id - site_name - from wmbs_location) to pnn (id - pnn - from wmbs_pnns) |
Still won't work. You can't store PNN or even PNN id in wmbs_location since that hardcodes a 1 to many relationship between location(where you submit jobs) and pnn (where you store files). Which is not correct, it's a many to many relationship. Which is the conclusion you came to, so I guess I can review a new version soon :-) ? |
|
A pretty bad jenkins output is coming soon, just don't bother about it. I still have to update all DAOs. |
| """CREATE TABLE wmbs_file_location ( | ||
| fileid INTEGER NOT NULL, | ||
| location INTEGER NOT NULL, | ||
| location VARCHAR(255), |
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.
Shouldn't this be integer?
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.
Also, this should be pnn, not location.
| """CREATE TABLE wmbs_file_location ( | ||
| fileid INTEGER NOT NULL, | ||
| location INTEGER NOT NULL | ||
| location VARCHAR(255) |
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.
shouldn't this be integer?
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.
Also, this should be pnn, not location.
| FOREIGN KEY(fileid) REFERENCES wmbs_file_details(id) | ||
| ON DELETE CASCADE, | ||
| FOREIGN KEY(location) REFERENCES wmbs_location(id) | ||
| FOREIGN KEY(location) REFERENCES wmbs_location_pnns(pnn) |
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.
Is there a reason to use foreign on wmbs_location_pnns instead of wmbs_pnns
| sql = """SELECT wfl.location as pnn, wfl.fileid as id | ||
| FROM wmbs_file_location wfl | ||
| WHERE wfl.fileid = :id | ||
| """ |
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.
If you need to return the same thing it should be pnn string not pnn integer.
need to join wmbs_pnns table.
| FROM wmbs_location_pnns wls, wmbs_file_details | ||
| WHERE wls.pnn = :location | ||
| AND wmbs_file_details.lfn = :lfn""" | ||
| VALUES ((SELECT id FROM wmbs_file_details WHERE lfn = :lfn ), :location)""" |
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.
same thing here need to join wmbs_pnns table to get location id (which is pnn id)
|
This seems very error prone changes although I agree with having separate pnn tables. There are too many things to changes. I wish there will be better solution. 😄 |
|
@hufnagel Dirk, do you use this DAO in the T0 agent: which is only used here: and nothing calls that Job method. |
|
|
||
| class GetAvailableFiles(DBFormatter): | ||
| sql = """SELECT wmbs_sub_files_available.fileid, wls.pnn AS pnn | ||
| sql = """SELECT wmbs_sub_files_available.fileid, wmbs_file_location.location AS pnn |
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.
Not clear to me why GetAvailable returns PNN while GetAcquired returns PSN...
|
And a few more DAOs not used anywhere: |
|
I've found several DAOs not used. I'll create a new issue and a new PR for that removal and we can follow up from there. |
38a81ba to
ed04683
Compare
|
Jenkins results:
|
b048b07 to
ada15c4
Compare
|
Jenkins results:
|
|
Thank you very much for the review, Seangchan and Dirk! I'm going to setup an oracle agent now and, if everything is Ok, I'll remove the label and ask you to merge it tomorrow. |
|
test this please |
1 similar comment
|
test this please |
|
Everything is awesome!!! All DMWM templates tested in both oracle and mysql wmagents (also central services running my private tag) and there are no errors in the logs, nothing crashed and workflows succeeded. @ticoann I think we can merge it once WMCore gets deployed on cmsweb production (but better merging this one first to avoid conflicts :)) |
|
Jenkins results:
|
|
Jenkins results:
|
|
Not a bad pylint fix, from I'm squashing these last two commits and it's good to go. |
Create index for wmbs_location_pnns pnn Proper ordering of the tables creation typo on table name Add unneeded files back; will be deleted in a separate PR Add new wmbs_pnns table and update other location tables Seangchan and Dirk suggestions for the new schema fix syntax errors in schema creation rename oracle fk constraint No need for a sequence for wmbs_location_pnns Update all DAOs and logic for the new wmbs_pnns table Update resource control New DAOs fix a few more DAOs ignore duplicate wmbs_location_pnns inserts More ResourceControl DAO fixes and site/se info fix GetLocationBulk dao select id from sequence for wmbs_pnns Fix oracle Locations.New dao Fixed Oracle.Locations.New DAO for wmbs_location_pnns apply SEangchans suggestion
fix logging test pylint fixes
9115c77 to
9fe2e40
Compare
|
Jenkins results:
|
|
test this please |
|
Jenkins results:
|
|
test this please |
|
Jenkins results:
|
|
test this please |
|
Baseline was screwed up this weekend |
|
Jenkins results:
|
|
@ticoann we better cut a new tag now, just in case :) |
|
I thought this works perfectly fine. 😄 I will cut a new tag 1.1.10.pre1 and run the test. |
|
Don't bother running tests Seangchan ;) |
Fix #8258
First commit has some improvements/unused code changes, which I applied while debugging that issue.
Second commit changes all wmbs file setters to set the PNN instead of the location (PSN mapped from PNN).
I'm trying not to change any logic in the code, but only change what we store in the database and adapt getters/setters.
@ticoann and @hufnagel can you please check whether I'm going at the right direction
Code is completely untested btw.