Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-1555

Mvcc node peek could contain stale data

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

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Done
    • 3.0.3.GA, 3.1.0.GA, 3.2.0.GA, 3.2.1.GA
    • 3.2.2.GA
    • Locking
    • None

    Description

      I've added some extra logging to the attached test case to find out where the problem is:

      2009-11-06 19:37:52,762 1064 DEBUG [org.jboss.cache.mvcc.MVCCNodeHelper] (pool-1-thread-1 Peek internal node for fqn /foo/mynode
      2009-11-06 19:37:52,763 1065 DEBUG [org.jboss.cache.mvcc.MVCCNodeHelper] (pool-1-thread-1 Peek returned UnversionedNode[ /foo/mynode data=[scalar]]@14e45b3
      2009-11-06 19:37:52,763 1065 TRACE [org.jboss.cache.lock.MVCCLockManager] (pool-1-thread-1 Attempting to lock /foo/mynode
      ...
      2009-11-06 19:37:52,763 1065 TRACE [org.jboss.cache.commands.write.PutKeyValueCommand] (pool-1-thread-1 Perform('GlobalTransaction:<null>:3', '/foo/mynode', k='lockthisplease', v='lockthisplease')
      ...
      2009-11-06 19:37:52,767 1069 DEBUG [org.jboss.cache.mvcc.MVCCNodeHelper] (pool-1-thread-5 Peek internal node for fqn /foo/mynode
      2009-11-06 19:37:52,767 1069 DEBUG [org.jboss.cache.mvcc.MVCCNodeHelper] (pool-1-thread-5 Peek returned UnversionedNode[ /foo/mynode data=[scalar]]@14e45b3
      2009-11-06 19:37:52,767 1069 TRACE [org.jboss.cache.lock.MVCCLockManager] (pool-1-thread-5 Attempting to lock /foo/mynode
      ...
      2009-11-06 19:37:52,774 1076 TRACE [org.jboss.cache.lock.MVCCLockManager] (pool-1-thread-1 Attempting to unlock /foo/mynode
      ...
      2009-11-06 19:37:52,777 1079 DEBUG [org.jboss.cache.mvcc.RepeatableReadNode] (pool-1-thread-5 underlyingNode is UnversionedNode[ /foo/mynode data=[scalar, _lockthisplease_]]@fa39d7
      2009-11-06 19:37:52,777 1079 DEBUG [org.jboss.cache.mvcc.RepeatableReadNode] (pool-1-thread-5 node is UnversionedNode[ /foo/mynode data=[scalar]]@14e45b3
      2009-11-06 19:37:52,778 1080 WARN [org.jboss.cache.mvcc.RepeatableReadNode] (pool-1-thread-5 Detected write skew on Fqn [/foo/mynode]. Another process has changed the node since we last read it!. Unable to copy node for update.

      pool-1-thread-5 has peeked too early! it was waiting for lock that pool-1-thread-1 one and carried with old data. In the mean time, pool-1-thread-1 wrote the data and unlocked which allowed pool-1-thread-5 to continue but it had cached data that is now stale.

      Attachments

        1. Chtimi2Test.java
          6 kB
        2. jbosscache.log
          234 kB
        3. logging-changes.txt
          10 kB

        Issue Links

          Activity

            People

              gzamarre Galder Zamarreño
              gzamarre Galder Zamarreño
              Archiver:
              samahaja@redhat.com Sagar Mahajan

              Dates

                Created:
                Updated:
                Resolved:
                Archived: