irods / irods

Open Source Data Management Software
https://irods.org
BSD 3-Clause "New" or "Revised" License
447 stars 138 forks source link

imkdir idempotency handling #6602

Open kript opened 2 years ago

kript commented 2 years ago

Bug Report

iRODS Version, OS and Version

4.2.7 Ubuntu 18.04

What did you try to do?

imkdir -p

Expected behavior

Error 809000

Observed behavior (including steps to reproduce, if applicable)

irods@irods:~$ imkdir -p test
irods@irods:~$ echo $?
0
irods@irods:~$ imkdir -p test
irods@irods:~$ echo $?
0
trel commented 2 years ago

Working as designed? Why would you expect an error in this serialized case?

Logs are clean. The linked issue was about concurrent imkdir -p requests, and that the logs were noisy... which cannot be helped for concurrent requests.

kript commented 2 years ago

I guess I am a little confused as #5979 infers that imkdir -p on an existing directory should emit the error.

Also, its to a concurrent error, if you run imkdir -p twice the second time you get an error in the logs. If there is no actionable error, could it be moved to DEBUG perhaps? Might be better stated in the other issue...

trel commented 2 years ago

When two API requests come in to the server - they each assess whether an INSERT should be committed to the database.

In the serialized case, the second request determines that an INSERT is not needed - and everything is quiet.

In the concurrent case, both assess that an INSERT is needed, but the second one errors out as duplicate - which writes to the log. The API itself understands and ignores that error before returning success to the client.

Alternate approaches, rather than 'check and then insert'...