a little test with replicated caching

Topics: User Forum
Jan 28, 2009 at 5:52 AM
Edited Jan 28, 2009 at 5:59 AM
Hello,

I'm doing a little test (using v 2.0.4) with replicated topology and involves 2 cache server and 2 client.

The configuration is as follow :

SERVER A:
    <replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
        <serverSetting
                ServiceCacheIpAddress="127.0.0.1"
                ServiceCacheIpPort="48888"
                SharedCacheVersionNumber="2.0.4.276"
                LoggingEnable="1"
                ServiceFamilyMode="1"
                CacheAmountOfObjects="-1"
                CacheAmountFillFactorInPercentage="90"
                ServiceCacheCleanup="LRU"
                ServiceCacheCleanupThreadJob="3600000"
                TcpServerMaxThreadToSet="-1"
                TcpServerMinThreadToSet="-1"
            />
        <replicatedServers>
            <add key="SERVER-B" ipaddress="192.168.0.122" port="48888" />
        </replicatedServers>

SERVER B :
    <replicatedSharedCache defaultProvider="ServerSharedCacheProvider">
        <serverSetting
                ServiceCacheIpAddress="127.0.0.1"
                ServiceCacheIpPort="48888"
                SharedCacheVersionNumber="2.0.4.276"
                LoggingEnable="1"
                ServiceFamilyMode="1"
                CacheAmountOfObjects="-1"
                CacheAmountFillFactorInPercentage="90"
                ServiceCacheCleanup="LRU"
                ServiceCacheCleanupThreadJob="3600000"
                TcpServerMaxThreadToSet="-1"
                TcpServerMinThreadToSet="-1"
            />
        <replicatedServers>
            <add key="SERVER-A" ipaddress="192.168.0.125" port="48888" />
        </replicatedServers>

CLIENT 1:
  <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
    <clientSetting
                SharedCacheVersionNumber="2.0.4.276"
                LoggingEnable="1"
                CompressionEnabled="0"
                CompressionMinSize="1024000"
                SocketPoolMinAvailableSize="5"
                HashingAlgorithm="Hashing" />
    <servers>
      <add key="SERVER-B"    ipaddress="192.168.6.122" port="48888"/>
    </servers>
    <replicatedServers>
      <add key="SERVER-A"    ipaddress="192.168.6.125" port="48888"/>
    </replicatedServers>

CLIENT 2:
  <indexusNetSharedCache defaultProvider="IndexusSharedCacheProvider">
    <clientSetting
                SharedCacheVersionNumber="2.0.4.276"
                LoggingEnable="1"
                CompressionEnabled="0"
                CompressionMinSize="1024000"
                SocketPoolMinAvailableSize="5"
                HashingAlgorithm="Hashing" />
    <servers>
      <add key="SERVER-A"    ipaddress="192.168.6.125" port="48888"/>
    </servers>
    <replicatedServers>
      <add key="SERVER-B"    ipaddress="192.168.6.122" port="48888"/>
    </replicatedServers>

The sync process went well actually. Client-1 insert data to Server-B, Client-2 then get the data from Server-A (you can view the detail  here).

However, if i reverse the process: change the client configuration so that Client-1 insert to Server-A and Client-2 get the data from Server-B, it looks that the data from Server-A isn't sync to Server-B.

My question:

1. Is it the correct behavior of replicated caching?
2. How the sync works in replicated caching scenario ? why in my case, the data isn't sync ?

Thanks!
Coordinator
Jan 28, 2009 at 1:27 PM
i will check it out later on, but what i have seen so far you do not have to setup replicated caching in your clients.

the clients can contain "servers" element but not "replicatedServers"

regards, roni        
Jan 29, 2009 at 12:58 AM
But the document say so  (http://www.sharedcache.com/cms/client_replicated_caching.aspx)

regards.
Coordinator
Jan 29, 2009 at 9:17 PM
you have to configure this for backup reasons thats correct - sorry for my wrong info in my previous post. 

so far i didn't found the time to evaluate your issue but in the next few day's i gone make test it over here.     
Jan 30, 2009 at 12:29 AM
Edited Jan 30, 2009 at 12:30 AM
ah... the backup thing is works, if the pc in the <servers> section is down, the request is redirected to servers in <replicatedServers> which is very cool. Also if server A is restarted, the cache will be repopulated from server-B upon the client request. Nice work ron!
Feb 4, 2009 at 2:45 AM
Here's the server-log file, it seem the sync is not executed at all.

* Log file from Server-A (192.168.0.125)

> Client
2009-02-04 09:51:41.4069|INFO||SERVER-A:           127.0.0.1:2432      1    ID        51    Action    Statistic                    Status    Request       Amount         35
2009-02-04 09:51:41.4069|INFO||SERVER-A:           127.0.0.1:2432      1    ID        51    Action    Successful                   Status    Response      Amount         35

> Server (General)
2009-02-04 09:50:57.1248|INFO||SERVER-A: Connected by client: 192.168.0.120:2743; current amount of connected clients: 1
2009-02-04 09:51:41.4069|INFO||SERVER-A: Connected by client: 127.0.0.1:2432; current amount of connected clients: 2
2009-02-04 09:55:27.3956|INFO||SERVER-A: Current Cache Count: 1 [Wednesday, February 04, 2009 9:55:27 AM]

> Server (Sync)
2009-02-04 09:50:57.1248|INFO||    Enque: ID:        26; Action:     Add                ;     Status:     ReplicationRequest;

> Server (traffic)
2009-02-04 09:50:57.1248|INFO||SERVER-A:       192.168.0.120:2743     10    ID         3    Action    Add                          Status    Request       Amount       3187
2009-02-04 09:51:41.4069|INFO||SERVER-A:           127.0.0.1:2432     11    ID        51    Action    Statistic                    Status    Request       Amount         35
2009-02-04 09:51:46.1570|INFO||SERVER-A: Client Disconnected: 10054; 127.0.0.1:2432

* Log file from Server-B (192.168.0.120)

> Client (traffic)
2009-02-04 09:50:57.0136|INFO||SERVER-B:       192.168.0.120:2743      1    ID         3    Action    Add                          Status    Request       Amount       3187
2009-02-04 09:50:57.0293|INFO||SERVER-B:       192.168.0.120:2743      1    ID         3    Action    Successful                   Status    Response      Amount       3187
2009-02-04 09:51:34.7379|INFO||SERVER-B:           127.0.0.1:2741      1    ID         8    Action    Statistic                    Status    Request       Amount         35
2009-02-04 09:51:34.7379|INFO||SERVER-B:           127.0.0.1:2741      1    ID         8    Action    Successful                   Status    Response      Amount         35

> Server (general)
2009-02-04 09:51:22.5018|INFO||SERVER-B: Connected by client: 192.168.0.120:2746; current amount of connected clients: 2

> Server (traffic)
2009-02-04 09:51:22.5018|INFO||SERVER-B:       192.168.0.120:2746     11    ID         2    Action    Get                          Status    Request       Amount         43
2009-02-04 09:51:26.2523|INFO||SERVER-B: Client Disconnected: 10054; 192.168.0.120:2746
2009-02-04 09:51:34.7379|INFO||SERVER-B:           127.0.0.1:2741     10    ID         8    Action    Statistic                    Status    Request       Amount         35
2009-02-04 09:51:37.0820|INFO||SERVER-B: Client Disconnected: 10054; 127.0.0.1:2741

Coordinator
Feb 4, 2009 at 6:48 AM
i will re-test tonight (european time) if i can reproduce failures in replicated caching, all my replication tests run successfully before i released the latest version but i will recheck today and try to response as soon as possible. do you have any code you are able to share which could give me an idea what kind of data you add to cache?

regards

Feb 5, 2009 at 9:17 AM
For the data I'm using CSLA object.
Coordinator
Feb 5, 2009 at 8:42 PM
hi,  so far i didn't found the time to retest it but i hope i'm able to manage this tomorrow friday or latest by this weekend. regards, roni
Mar 23, 2009 at 8:18 AM
Nevermind, i'll follow this thread follow http://sharedcache.codeplex.com/Thread/View.aspx?ThreadId=50017 and seem similiar prob with mine which is still unresolved untill now.
Coordinator
Mar 23, 2009 at 8:44 AM
Edited Mar 23, 2009 at 8:44 AM
Hi,

the changeset: 26202 contains the fix for this issue which was submitted by Kent

regards,
roni
Mar 23, 2009 at 8:52 AM
cool.

Thanks !