Looking at our Admin Logs, we have so many issues with the Duplicate entry when doing an insert in to the lock_keys table. Our system is pretty heavily loaded and this really only seems to appear during high concurrency.
Problem is, it is completely cluttering up the log to the point where we do miss the occasional important item.
Looking into this, on solution I have seen (really the only one i could find anywhere) was to wrap the try-catch with an if key exists check and if it did, just putOffExpiration. Trying this it didn't really help.
What did help was using that if key exists check in conjunction with changing the INSERT to a REPLACE.
// FROM 'INSERT INTO ?:lock_keys (key_id, token, expiry_at) VALUES (?s, ?s, UNIX_TIMESTAMP(NOW()) + ?i)', //TO 'REPLACE INTO ?:lock_keys (key_id, token, expiry_at) VALUES (?s, ?s, UNIX_TIMESTAMP(NOW()) + ?i)',
What i cannot find is any information related to the DatabaseStore.php file and what the impact of doing this will be.
I do know that REPLACE is slower than INSERT. However, using Exception Handling to catch something that can be handled with the above seems like a better option. I just don't know or can find what the purpose or issues I may face could be.
Anyone else seeing this or have suggestions or info?