6 Replies Latest reply on Nov 5, 2008 3:06 PM by lovelyliatroim

    Buddy migration and removal

    genman

      I was trying to get timed removal to work with buddy replication: JBCACHE-1435

      So instead of using an eviction policy, I wrote my own timer to remove nodes from the cache.

      It works fine except when the data gets migrated from one cache to the other. In which case, the data copied to cache2 has no timer active to force removal. Essentially we have:

      1. cache1.put(X, Y)
      2. cache2.get(X) // returns Y, thanks to migration
      3. cache1.remove(X) (from timer)
      4. cache1.get(X) // returns Y

      Here's what I got:

      4328 INFO [main] - ___ service ___
      JBossCacheService#1 state=STARTED cache=/ null
       /min null
       /500500 null
       /5005001042 {V={MDN=5005000958 MIN=5005001042 IP=127.0.0.42 CID= null}}
       /_BUDDY_BACKUP_ null
       /192.168.0.9_1832 null
       /mdn null
       /500500 null
       /5005000958 {V=5005001042}
       channelFactory=org.jgroups.JChannelFactory@18ed77a
      4328 INFO [main] - ___ service2 ___
      JBossCacheService#3 state=STARTED cache=/ null
       /_BUDDY_BACKUP_ null
       /192.168.0.9_1830 null
       /min null
       /500500 null
       /5005001042 {V={MDN=5005000958 MIN=5005001042 IP=127.0.0.42 CID= null}}
       /mdn null
       /500500 null
       /5005000958 {V=5005001042}
       channelFactory=org.jgroups.JChannelFactory@15fc672
      4547 INFO [main] - ___ wait for remove ___
      5094 DEBUG [pool-1-thread-1] JBossCacheService - remove 5005001042
      7547 INFO [main] - ___ service ___
      JBossCacheService#1 state=STARTED cache=/ null
       /min null
       /500500 null
       /_BUDDY_BACKUP_ null
       /192.168.0.9_1832 null
       /min null
       /500500 null
       /5005001042 {V={MDN=5005000958 MIN=5005001042 IP=127.0.0.42 CID= null}}
       /mdn null
       /500500 null
       /5005000958 {V=5005001042}
       /mdn null
       /500500 null
       channelFactory=org.jgroups.JChannelFactory@18ed77a
      7547 INFO [main] - ___ service2 ___
      7547 INFO [main] -
      JBossCacheService#3 state=STARTED cache=/ null
       /min null
       /500500 null
       /5005001042 {V={MDN=5005000958 MIN=5005001042 IP=127.0.0.42 CID= null}}
       /_BUDDY_BACKUP_ null
       /192.168.0.9_1830 null
       /min null
       /500500 null
       /mdn null
       /500500 null
       /mdn null
       /500500 null
       /5005000958 {V=5005001042}
       channelFactory=org.jgroups.JChannelFactory@15fc672
      


      Suggestions?