Skip to content

Conversation

fstagni
Copy link
Contributor

@fstagni fstagni commented May 16, 2025

BEGINRELEASENOTES

*WMS
NEW: added tables of summaries and triggers to fill their content

ENDRELEASENOTES

@fstagni fstagni force-pushed the table_summaries branch 2 times, most recently from b98978f to f32b961 Compare May 19, 2025 14:26
@fstagni fstagni changed the title feat: use summary tables and triggers (PilotAgentsDB.PilotAgents, distinct values) [9.0] feat: use summary tables and triggers May 19, 2025
@fstagni fstagni force-pushed the table_summaries branch 6 times, most recently from abc0efc to aaadeea Compare May 20, 2025 15:47
@fstagni fstagni force-pushed the table_summaries branch 3 times, most recently from 86a7cc4 to d263910 Compare May 26, 2025 13:59
@fstagni fstagni marked this pull request as ready for review May 26, 2025 14:32
@fstagni fstagni requested a review from atsareg as a code owner May 26, 2025 14:32
@fstagni fstagni force-pushed the table_summaries branch from 8145130 to 5238904 Compare May 26, 2025 15:46
@fstagni fstagni force-pushed the table_summaries branch 2 times, most recently from d4d430d to f492bc0 Compare May 27, 2025 08:50
if "Monitoring" in self.pilotMonitoringOption:
self.log.info("Committing PilotsHistory to Monitoring")
result = PilotAgentsDB().getSummarySnapshot()
sql = "SELECT * FROM PilotsHistorySummary ORDER BY GridSite, DestinationSite, Status, VO;"
Copy link
Contributor

Choose a reason for hiding this comment

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

why writing the query directly here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it is the only place where we need it and I did not want to create a new method in the DB class. I understand it's not very elegant, but it's simpler and anyway DIRAC will keep using these hand-written queries for MySQL only.

Return Distinct Values of Owner job Attribute in WMS
"""
return cls.jobDB.getDistinctJobAttributes("Owner", condDict, older, newer)
return cls.jobDB._query("SELECT DISTINCT Owner FROM JobsHistorySummary")
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure that there is any benefit in these changes, given that the Job table has an index on all these parameters. I just tried on the LHCb production instance, it returns the answer in 0.021s for Owner for example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will probably be even less for the summary table. I agree with you that it's minor improvement anyway.


-- summary for JobsHistory

DROP TABLE IF EXISTS `JobsHistorySummary`;
Copy link
Contributor

Choose a reason for hiding this comment

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

From the operational point of view, how do you see that happening ? You need to fill in that table with an initial content representing the current state. That will take for ever and require a downtime no ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For everyone but LHCb this is just one more thing to be done during the update downtime.

For LHCb:

  • the current query (which is what you would theoretically want to do) takes at most 15 minutes, not "for ever"
  • But anyway, I have something in mind to avoid that, but no need to write it down here.

@fstagni fstagni force-pushed the table_summaries branch 4 times, most recently from 655119a to 581f099 Compare June 17, 2025 14:27
@fstagni fstagni force-pushed the table_summaries branch 3 times, most recently from 10759e7 to e33c0bb Compare June 19, 2025 09:52
@fstagni fstagni requested a review from andresailer as a code owner June 26, 2025 11:56
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.

3 participants