CDLUC3 / mrt-doc

Documentation and Information regarding the Merritt repository
8 stars 4 forks source link

[Inventory] SQL error when updating objects in Integration Test #2024

Open mreyescdl opened 2 months ago

mreyescdl commented 2 months ago

We are seeing an SQL error in the Integration test that performs an object update. David is looking into issue. Possibly a Zookeeper lock problem. Also related is to make sure that Inventory populates the "Status" and "Status Message" upon error or completion of task. Ingest needs this to continue the processing chain.

[debug] SaveObject:  Releasing Zookeeper lock: ark:/99999/fk4km0zv01
Exception - sql=insert into inv_objects set object_type='MRT-curatorial',modified='2024-09-10 09:45:26',version_number='1',md5_3='182',ark='ark:/99999/fk4km0zv01',inv_owner_id='4',role='MRT-content' - exception:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'ark:/99999/fk4km0zv01' for key 'inv_objects.ark_UNIQUE'
EXception:SaveObject: Exception for entry id=ark:/99999/fk4km0zv01 - Exception:org.cdlib.mrt.inv.utility.DBAdd-exec:310 SQL_EXCEPTION[SQL exception] Exception - sql=insert into inv_objects set object_type='MRT-curatorial',modified='2024-09-10 09:45:26',version_number='1',md5_3='182',ark='ark:/99999/fk4km0zv01',inv_owner_id='4',role='MRT-content' - exception:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'ark:/99999/fk4km0zv01' for key 'inv_objects.ark_UNIQUE' - Exception:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'ark:/99999/fk4km0zv01' for key 'inv_objects.ark_UNIQUE'
[debug] SaveObject:  Releasing Zookeeper lock: ark:/99999/fk4km0zv01
mreyescdl commented 2 months ago

@dloy I created a test case that submits the same object in a batch manifest 5 times. This should test the locking in Inventory. On first run, it failed. When you get a chance, can you have a look?

        :Number of pending job(s): 0
        :Number of completed job(s): 1
        :Number of failed job(s): 4

Status: Failed
Status Message: org.cdlib.mrt.inv.utility.DBAdd-exec:310 SQL_EXCEPTION[SQL exception] Exception - sql=insert into inv_objects set object_type='MRT-curatorial',modified='2024-09-17 13:23:57',version_number='1',md5_3='5c6',ark='ark:/99999/fk4zc9mb26',inv_owner_id='4',role='MRT-content' - exception:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'ark:/99999/fk4zc9mb26' for key 'inv_objects.ark_UNIQUE' - Exception:java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'ark:/99999/fk4zc9mb26' for key 'inv_objects.ark_UNIQUE'