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

JdbcStringBasedStore Purge should not use FOR UPDATE to avoid excessive locking

    XMLWordPrintable

Details

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              wburns@redhat.com Will Burns
              remerson@redhat.com Ryan Emerson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: