Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-11110

JdbcStringBasedStore Purge should not use FOR UPDATE to avoid excessive locking

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      https://issues.redhat.com/browse/ISPN-10337 Added the FOR UPDATE to the select query used by the purge method in order to ensure that the purge method would lock all of the affected rows so that no subsequent updates to a key could be incorrectly removed by the purge method.

      However, if the purge does a select for update and does a single commit at the end of the purge, that will block write operations on all the expired keys for the entire duration of the purge. The clustered purge listener does cache.removeLifespanExpired(key, null, null).join(), so the entire duration of the purge could mean a really long time.

      Instead we should utilise a normal select query followed by a 'delete from table where id = ? and timestamp = ?' to prevent accidentally deleting an update.

              wburns@redhat.com Will Burns
              remerson@redhat.com Ryan Emerson
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: