tagbase / tagbase-server

tagbase-server is a data management web service for working with eTUFF and nc-eTAG files.
https://oiip.jpl.nasa.gov/doc/OIIP_Deliverable7.4_TagbasePostgreSQLeTUFF_UserGuide.pdf
Apache License 2.0
7 stars 2 forks source link

metadata.tag_id incorrectly mimics metadata.submission_id #224

Closed lewismc closed 1 year ago

lewismc commented 1 year ago

Jesus reported the following...

Hi everyone, I have done some quick load tests and noticed this. The tag_id in the METADATA table does not match the tag_id in the submission table. In the submission table the same id is assigned ( if it is the same name) but in the metadata table they are still correlative. I will have to check if this happens in the other tables.

image

lewismc commented 1 year ago

Actually, in my local testing when I reverted processing_utils.py to it's previous state and run some ingestion tasks I still observe metadata.tag_id incrementing inline with the submission_id. This makes me think that this bug has been there longer and just not been caught until now. The SQL INSERT statement can be seen at https://github.com/tagbase/tagbase-server/blob/main/tagbase_server/tagbase_server/utils/processing_utils.py#L214-L223 As you can see we use the submission_id instead of the tag_id. We need to acquire the tag_id from earlier ingestion logic. Probably from obtaining curval for the tag_id sequence.