VMware GemFire

 View Only

 We have partition reasons which is configured with cache loader for cache miss and that cache loader is supposed to get data from Cassandra back store and update the cache. Though cache loader is invoked, its not updating cache.

Sumit Das's profile image
Sumit Das posted Jul 03, 2020 08:02 AM

Here is my client conf.

@ClientCacheApplication(name = "store-client", subscriptionEnabled = true)\\n@EnableEntityDefinedRegions(basePackageClasses = {IdRevisionEntity.class}, clientRegionShortcut = CACHING_PROXY)\\n@EnableGemfireRepositories(basePackages = {"com.store.gemfire.cache.repository"})

Here is the pojo for partition region.

@PartitionRegion(REGION_NAME)\\npublic class IdRevisionEntity implements Serializable {\\n \\n private static final long serialVersionUID = 2517140628447391099L;\\n public static final String REGION_NAME = "IDREVISONENTITY";\\n \\n @Id\\n private IdRevisionEntityCacheKey id;\\n private EntityRevision entityRevision;\\n}

Server conf for cache loader

 

<gfe:region-template id="extendedRegionTemplate" template="baseRegionTemplate" load-factor="${capture.cache-server.extendedRegionTemplate.load-factor:0.75}">\\n <gfe:cache-loader ref="idRevisionEntityLoader"/>\\n <gfe:cache-writer ref="idRevisionEntityCacheWriter"/>\\n <gfe:async-event-queue-ref bean="async-event-queue"/>\\n </gfe:region-template>\\n \\n \\n <gfe:partitioned-region id="IDREVISONENTITY" template="extendedRegionTemplate" copies="${capture.cache-server.idRevisionEntity.copies:1}"\\n load-factor="${capture.cache-server.idRevisionEntity.load-factor:0.75}" persistent="true"\\n key-constraint="com.store.gemfire.cache.model.IdRevisionEntityCacheKey"\\n value-constraint="com.store.gemfire.cache.model.IdRevisionEntity"\\n total-buckets="${capture.cache-server.idRevisionEntity.total-buckets:91}" disk-store-ref="DEFAULT" gateway-sender-ids="cacheEventSender">\\n <gfe:eviction type="HEAP_PERCENTAGE" action="OVERFLOW_TO_DISK"/>\\n </gfe:partitioned-region>

Below log clearly shows cache miss invoked cache loader.

 

2020-07-03 00:51:58.274 INFO 24088 --- [ 12300 Thread 3] c.j.c.g.c.s.g.c.s.IdRevisionEntityLoader : Loading of data against key :IdRevisionEntityCacheKey(dataType=GEMFIRE_PAYMENT, id=T041, revisionType=LATEST)\\n2020-07-03 00:51:58.470 INFO 24088 --- [ 12300 Thread 3] c.j.c.g.c.s.g.c.s.IdRevisionEntityLoader : Getting output result 1\\n2020-07-03 00:51:58.473 INFO 24088 --- [ 12300 Thread 3] c.j.c.g.c.s.g.c.s.IdRevisionEntityLoader : Entity retrieved successfully

But same result is not updated in the cache and client is the below error.

 

remote server on WSG194036(store:9092:loner):55921:1ed0f810:store: While performing a remote get

 

 

Sumit Das's profile image
Sumit Das

typo.. its partition regions..sorry

Juan Ramos's profile image
Juan Ramos

Hello Sumit,

 

Thanks for contacting the Support Community!.

Can you share the source code for the idRevisionEntityLoader bean?. Also, is there any exception logged on the server executing the Loader?.

Best regards.

Sumit Das's profile image
Sumit Das

public class IdRevisionEntityLoader implements CacheLoader<IdRevisionEntityCacheKey, IdRevisionEntity>, Declarable {

public class IdRevisionEntityLoader implements CacheLoader<IdRevisionEntityCacheKey, IdRevisionEntity>, Declarable {\\n public IdRevisionEntity load(LoaderHelper<IdRevisionEntityCacheKey, IdRevisionEntity> loaderHelper) throws CacheLoaderException {\\n //business logic to load data from cassandra\\nreturn IdRevisionEntity;\\n}\\n \\n}

There is no error in execution of loader, logs you can see....

Juan Ramos's profile image
Juan Ramos

Hello Sumit,

 

Thanks for the code snippet.

It's hard to diagnose this without having further information and full access to the log files from the servers, I'd suggest you open a ticket through the Support Portal so one of our support engineers can help you further.

Best regards.

Sumit Das's profile image
Sumit Das

Can you provide the link where we can open a ticket?

Juan Ramos's profile image
Juan Ramos

Hello Sumit,

 

You can find the instructions here [1].

Best regards.

 

[1]: https://tanzu.vmware.com/content/support/support-onboarding