Replies: 1 comment
-
This is very old code, not modified for years. Make a PR so that we can evaluate better please. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear all,
After having migrated our AccountingDB and Accounting services from a DataCenter to another I have issues during the insert into ac_in tables, i.e.:
etc.
The error is the following:
After some checks this is due to the returned value of cursor.lastrowid which is 0 in this case, see:
https://github.com/DIRACGrid/DIRAC/blob/integration/src/DIRAC/Core/Utilities/MySQL.py#L794
while on another mysql instance the returned value is the one of the auto_increment variable.
I've also checked the imported tables and they correspond exactly to the original ones.
This issue then prevents the successive imports since it's found that there is a Duplicated entry:
2024-01-16 07:11:55 UTC Accounting/DataStore/Accounting/AccountingDB ERROR: _update (INSERT INTO
ac_in_CTA_PilotSubmission(
id,
taken,
takenSince,
HostName,
SiteDirector,
Site,
CE,
Queue,
Status,
NumTotal,
NumSucceeded,
startTime,
endTime) VALUES ( "0", "0", UTC_TIMESTAMP(), "DIRAC.dcta-servers03.pic.es", "SiteDirectorIN2P3", "LCG.IN2P3-CC.fr", "cccondorce02.in2p3.fr", "cccondorce02.in2p3.fr:share", "Succeeded", "11", "11", "1705328203", "1705328203" )): Execution failed. 1062: Duplicate entry '0' for key 'PRIMARY'
So in order to make the code working correctly I had to modify the insert command by removing the explicit set to '0' for the id column by modifying:
to:
here:
https://github.com/DIRACGrid/DIRAC/blob/integration/src/DIRAC/AccountingSystem/DB/AccountingDB.py#L544
https://github.com/DIRACGrid/DIRAC/blob/integration/src/DIRAC/AccountingSystem/DB/AccountingDB.py#L545
I don't know if there is a specific reason to set id=0, but I found that in our case it's causing problems.
Any thoughts?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions