5 Replies Latest reply: Feb 7, 2013 6:16 PM by robvarga RSS

    Missing entries in write-behing caching!

    982729
      Hi,



      I am accessing write-behind cache in my coherence cluster from app server. Below is my scheme,



                <distributed-scheme>

                     <scheme-name>example-cache-scheme</scheme-name>

                     <service-name>DistributedCache</service-name>

                     <thread-count>50</thread-count>

                     <backing-map-scheme>



                          <!-- Read-write-backing-map caching scheme. -->

                          <read-write-backing-map-scheme>

                               <scheme-name>ExampleCacheScheme</scheme-name>

                               <internal-cache-scheme>

                                    <local-scheme>

                                         <scheme-ref>noneviction</scheme-ref>

                                    </local-scheme>

                               </internal-cache-scheme>

                               <write-max-batch-size>300</write-max-batch-size>

                               <cachestore-scheme>

                                    <class-scheme>

                                         <class-name>com.example.store.ExampleCacheStore

                                         </class-name>

                                    </class-scheme>

                               </cachestore-scheme>

                               <write-delay>2s</write-delay>

                               <write-batch-factor>1.0<;/write-batch-factor>

                          </read-write-backing-map-scheme>

                     </backing-map-scheme>

                </distributed-scheme>



      Always few entries are no communicated to store()/storeAll() method. For example if I put 10 entries only 4 entries are notified to storeAll() !!

      What could be the issue ? Am I missing something ?

      Thanks
      Maria
        • 1. Re: Missing entries in write-behing caching!
          User738616-Oracle
          Hi Maria,

          As the method name and signature suggests storeAll() commits a set of entries and not a single entry. So your 10 entries are committed in 4 batches.

          HTH

          Cheers,
          NJ
          • 2. Re: Missing entries in write-behing caching!
            982729
            Hi NJ,

            You are right. Entries can be batched up. But I have mentioned <write-batch-factor>1.0<;/write-batch-factor> and <write-max-batch-size>300</write-max-batch-size> .
            Which says my batch size could be anything <=300 , and write-batch-factor=1.0 which should consider soft-ripe entries also. So , if I put 10 entries (without any delay) definitely all 10 must come as a batch.

            Here I am getting only 4 entries in storeAll() and the rest 6 entries are never received !!
            Is it a bug with read-write-backing-map ? I am clueless !


            Thanks
            Maria
            • 3. Re: Missing entries in write-behing caching!
              User738616-Oracle
              Hi Maria,

              No there are no bugs with the read-write-backing-map scheme and this product feature is available from long time so I really don't think it is an issue with Coherence. Please check:

              - How many storage enabled nodes are running in your Cluster? Are you capturing the storeAll() call on all the nodes?
              - Is your client application storage-disabled and if not then are you capturing storeAll() calls on the client node as well?

              Remember all the storage enabled nodes will invoke storeAll() for the data that they are owners for primary partitions.

              HTH

              Cheers,
              _NJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
              • 4. Re: Missing entries in write-behing caching!
                879423
                Hi
                I assume that you at least get the very last value you entered from the batch of 10 in the database. If that is the case it may be that you are getting coalesced writes which (at least as far as I've been told) can happen before the write behind thread has woken up. Have you experimented with lowering the write behind value and seeing if you get the same behaviour?
                • 5. Re: Missing entries in write-behing caching!
                  robvarga
                  Jestina.Nancy wrote:
                  Hi NJ,

                  You are right. Entries can be batched up. But I have mentioned <write-batch-factor>1.0<;/write-batch-factor> and <write-max-batch-size>300</write-max-batch-size> .
                  Which says my batch size could be anything <=300 , and write-batch-factor=1.0 which should consider soft-ripe entries also. So , if I put 10 entries (without any delay) definitely all 10 must come as a batch.

                  Here I am getting only 4 entries in storeAll() and the rest 6 entries are never received !!
                  Is it a bug with read-write-backing-map ? I am clueless !


                  Thanks
                  Maria
                  Hi Maria,

                  did you enable logging in the single entry store() method too? If you have multiple nodes, it is possible that only a single changed entry was on a node in which case store() would be invoked and not storeAll().

                  Best regards,

                  Rob